diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:08:33 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:08:33 +0000 | 
| commit | 20d35e67e67f106f617c939725101223211659f0 (patch) | |
| tree | 64eb963cbf5ba58765e0a6b64a440965d66a7a4d /test/ELF/linkerscript/data-commands1.test | |
| parent | ae1a339de31cf4065777531959a11e55a2e5fa00 (diff) | |
Notes
Diffstat (limited to 'test/ELF/linkerscript/data-commands1.test')
| -rw-r--r-- | test/ELF/linkerscript/data-commands1.test | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/data-commands1.test b/test/ELF/linkerscript/data-commands1.test new file mode 100644 index 0000000000000..32c5978c30a8a --- /dev/null +++ b/test/ELF/linkerscript/data-commands1.test @@ -0,0 +1,45 @@ +# REQUIRES: x86,mips +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/data-commands.s -o %t.o +# RUN: ld.lld -o %t %t.o --script %s +# RUN: llvm-objdump -s %t | FileCheck %s + +SECTIONS { +  .foo : { +    *(.foo.1) +    BYTE(0x11) +    *(.foo.2) +    SHORT(0x1122) +    *(.foo.3) +    LONG(0x11223344) +    *(.foo.4) +    QUAD(0x1122334455667788) +  } +  .bar : { +    *(.bar.1) +    BYTE(a + 1) +    *(.bar.2) +    SHORT(b) +    *(.bar.3) +    LONG(c + 2) +    *(.bar.4) +    QUAD(d) +  } +} + +# CHECK:      Contents of section .foo: +# CHECK-NEXT:   ff11ff22 11ff4433 2211ff88 77665544 +# CHECK-NEXT:   332211 + +# CHECK:      Contents of section .bar: +# CHECK-NEXT:   ff12ff22 11ff4633 2211ff88 77665544 +# CHECK-NEXT:   332211 + +# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %p/Inputs/data-commands.s -o %t2.o +# RUN: ld.lld --script %s %t2.o -o %t2 +# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=BIGENDIAN %s +# BIGENDIAN:      Contents of section .foo: +# BIGENDIAN-NEXT:   ff11ff11 22ff1122 3344ff11 22334455 +# BIGENDIAN-NEXT:   667788 +# BIGENDIAN-NEXT: Contents of section .bar: +# BIGENDIAN-NEXT:   ff12ff11 22ff1122 3346ff11 22334455 +# BIGENDIAN-NEXT:   667788  | 
