69 lines · plain
1# RUN: llvm-mc -filetype=obj -triple x86_64 %s -o %t2# RUN: llvm-readelf -s %t | FileCheck %s3 4## Test that a variable declared with "var = other_var + cst" is in the same5## section as other_var and its value is the value of other_var + cst.6## In addition, its st_size inherits from other_var.7 8# CHECK: 0: {{.*}}9# CHECK-NEXT: 0000000000000001 42 OBJECT GLOBAL DEFAULT [[#A:]] a10# CHECK-NEXT: 0000000000000005 0 NOTYPE GLOBAL DEFAULT [[#A]] b11# CHECK-NEXT: 0000000000000001 42 OBJECT GLOBAL DEFAULT [[#A]] a112# CHECK-NEXT: 0000000000000002 42 OBJECT GLOBAL DEFAULT [[#A]] c13# CHECK-NEXT: 000000000000000d 42 OBJECT GLOBAL DEFAULT [[#A]] d14# CHECK-NEXT: 000000000000000d 42 OBJECT GLOBAL DEFAULT [[#A]] d115# CHECK-NEXT: 000000000000000d 42 OBJECT GLOBAL DEFAULT [[#A]] d216# CHECK-NEXT: 0000000000000001 41 OBJECT GLOBAL DEFAULT [[#A]] e17# CHECK-NEXT: 0000000000000001 41 OBJECT GLOBAL DEFAULT [[#A]] e118# CHECK-NEXT: 0000000000000001 41 OBJECT GLOBAL DEFAULT [[#A]] e219# CHECK-NEXT: 0000000000000002 42 OBJECT GLOBAL DEFAULT [[#A]] e320# CHECK-NEXT: 0000000000000005 0 NOTYPE GLOBAL DEFAULT [[#A]] test2_a21# CHECK-NEXT: 0000000000000005 0 NOTYPE GLOBAL DEFAULT [[#A]] test2_b22# CHECK-NEXT: 0000000000000009 0 NOTYPE GLOBAL DEFAULT [[#A]] test2_c23# CHECK-NEXT: 0000000000000009 0 NOTYPE GLOBAL DEFAULT [[#A]] test2_d24# CHECK-NEXT: 0000000000000004 0 NOTYPE GLOBAL DEFAULT ABS test2_e25# CHECK-NEXT: 0000000000000001 41 OBJECT GLOBAL DEFAULT [[#A]] e@v126 27 28 .data29 .globl a30 .size a, 4231 .byte 4232 .type a, @object33a:34 35 .long 4236 .globl b, a1, c, d, d1, d2, e, e1, e2, e337b:38a1 = a39c = a + 140 41## These st_size fields inherit from a.42d = a + (b - a) * 343.set d1, d44d2 = d145 46e = a + (1 - 1)47.size e, 4148## These st_size fields inherit from e instead of a.49## TODO e3's st_size should inherit from e.50.set e1, e51.set e2, e152e3 = e1 + 153 54 .globl test2_a55 .globl test2_b56 .globl test2_c57 .globl test2_d58 .globl test2_e59test2_a:60 .long 061test2_b = test2_a62test2_c:63 .long 064test2_d = test2_c65test2_e = test2_d - test2_b66 67## e@v1's st_size equals e's st_size.68.symver e, e@v169