1# REQUIRES: x86,mips
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/data-commands.s -o %t.o
3# RUN: ld.lld -o %t %t.o --script %s
4# RUN: llvm-objdump -s %t | FileCheck %s
5
6SECTIONS {
7  .foo : {
8    *(.foo.1)
9    BYTE(0x11)
10    *(.foo.2)
11    SHORT(0x1122)
12    *(.foo.3)
13    LONG(0x11223344)
14    *(.foo.4)
15    QUAD(0x1122334455667788)
16  }
17  .bar : {
18    *(.bar.1)
19    BYTE(a + 1)
20    *(.bar.2)
21    SHORT(b)
22    *(.bar.3)
23    LONG(c + 2)
24    *(.bar.4)
25    QUAD(d)
26  }
27}
28
29# CHECK:      Contents of section .foo:
30# CHECK-NEXT:   ff11ff22 11ff4433 2211ff88 77665544
31# CHECK-NEXT:   332211
32
33# CHECK:      Contents of section .bar:
34# CHECK-NEXT:   ff12ff22 11ff4633 2211ff88 77665544
35# CHECK-NEXT:   332211
36
37# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %p/Inputs/data-commands.s -o %t2.o
38# RUN: ld.lld --script %s %t2.o -o %t2
39# RUN: llvm-objdump -s %t2 | FileCheck --check-prefix=BIGENDIAN %s
40# BIGENDIAN:      Contents of section .foo:
41# BIGENDIAN-NEXT:   ff11ff11 22ff1122 3344ff11 22334455
42# BIGENDIAN-NEXT:   667788
43# BIGENDIAN-NEXT: Contents of section .bar:
44# BIGENDIAN-NEXT:   ff12ff11 22ff1122 3346ff11 22334455
45# BIGENDIAN-NEXT:   667788
46