2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 # RUN: echo "SECTIONS { \
5 # RUN: .hex1 : { *(.hex.1) } \
7 # RUN: .hex2 : { *(.hex.2) } \
9 # RUN: .kilo1 : { *(.kilo.1) } \
11 # RUN: .kilo2 : { *(.kilo.2) } \
13 # RUN: .mega1 : { *(.mega.1) } \
15 # RUN: .mega2 : { *(.mega.2) } \
17 # RUN: ld.lld %t --script %t.script -o %t2
18 # RUN: llvm-objdump -section-headers %t2 | FileCheck %s
21 # CHECK-NEXT: Idx Name Size Address
22 # CHECK-NEXT: 0 00000000 0000000000000000
23 # CHECK-NEXT: 1 .hex1 00000008 0000000000001000
24 # CHECK-NEXT: 2 .hex2 00000008 0000000000001010
25 # CHECK-NEXT: 3 .kilo1 00000008 0000000000002800
26 # CHECK-NEXT: 4 .kilo2 00000008 0000000000002c00
27 # CHECK-NEXT: 5 .mega1 00000008 0000000000100000
28 # CHECK-NEXT: 6 .mega2 00000008 0000000000200000
30 ## Mailformed number errors.
31 # RUN: echo "SECTIONS { \
33 # RUN: }" > %t2.script
34 # RUN: not ld.lld %t --script %t2.script -o %t3 2>&1 | \
35 # RUN: FileCheck --check-prefix=ERR1 %s
36 # ERR1: malformed number: 0x11h
38 # RUN: echo "SECTIONS { \
40 # RUN: }" > %t3.script
41 # RUN: not ld.lld %t --script %t3.script -o %t4 2>&1 | \
42 # RUN: FileCheck --check-prefix=ERR2 %s
43 # ERR2: malformed number: 0x11k
45 # RUN: echo "SECTIONS { \
47 # RUN: }" > %t4.script
48 # RUN: not ld.lld %t --script %t4.script -o %t5 2>&1 | \
49 # RUN: FileCheck --check-prefix=ERR3 %s
50 # ERR3: malformed number: 0x11m