2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 # RUN: echo "SECTIONS { \
5 # RUN: .aaa : { *(.aaa) } \
6 # RUN: .bbb : { *(.bbb) } \
7 # RUN: .ccc : { *(.ccc) } \
8 # RUN: _aaa = SIZEOF(.aaa); \
9 # RUN: _bbb = SIZEOF(.bbb); \
10 # RUN: _ccc = SIZEOF(.ccc); \
11 # RUN: _ddd = SIZEOF(.not_exist); \
13 # RUN: ld.lld -T %t.script %t.o -o %t
14 # RUN: llvm-readelf -S -s %t | FileCheck %s
16 # CHECK: Name Type Address Off Size
17 # CHECK: .aaa PROGBITS 0000000000000000 001000 000008
18 # CHECK-NEXT: .bbb PROGBITS 0000000000000008 001008 000010
19 # CHECK-NEXT: .ccc PROGBITS 0000000000000018 001018 000018
21 # CHECK: Value Size Type Bind Vis Ndx Name
22 # CHECK: 0000000000000008 0 NOTYPE GLOBAL DEFAULT ABS _aaa
23 # CHECK-NEXT: 0000000000000010 0 NOTYPE GLOBAL DEFAULT ABS _bbb
24 # CHECK-NEXT: 0000000000000018 0 NOTYPE GLOBAL DEFAULT ABS _ccc
25 ## SIZEOF(.not_exist) has a value of 0.
26 # CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT ABS _ddd