Silence -Wunused-variable in release builds.
[llvm/stm8.git] / test / MC / ELF / common.s
blob70e2ed2a95a6c2db461082a92f28146c3caba0cf
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck %s
4 .text
6 // Test that this produces a regular local symbol.
7 .type common1,@object
8 .local common1
9 .comm common1,1,1
11 // CHECK: ('st_name', 0x00000001) # 'common1'
12 // CHECK-NEXT: ('st_bind', 0x00000000)
13 // CHECK-NEXT: ('st_type', 0x00000001)
14 // CHECK-NEXT: ('st_other', 0x00000000)
15 // CHECK-NEXT: ('st_shndx',
16 // CHECK-NEXT: ('st_value', 0x0000000000000000)
17 // CHECK-NEXT: ('st_size', 0x0000000000000001)
20 // Same as common1, but with directives in a different order.
21 .local common2
22 .type common2,@object
23 .comm common2,1,1
25 // CHECK: ('st_name', 0x00000009) # 'common2'
26 // CHECK-NEXT: ('st_bind', 0x00000000)
27 // CHECK-NEXT: ('st_type', 0x00000001)
28 // CHECK-NEXT: ('st_other', 0x00000000)
29 // CHECK-NEXT: ('st_shndx',
30 // CHECK-NEXT: ('st_value', 0x0000000000000001)
31 // CHECK-NEXT: ('st_size', 0x0000000000000001)
33 .local common6
34 .comm common6,8,16
36 // CHECK: # Symbol 0x00000003
37 // CHECK-NEXT: (('st_name', 0x00000011) # 'common6'
38 // CHECK-NEXT: ('st_bind', 0x00000000)
39 // CHECK-NEXT: ('st_type', 0x00000001)
40 // CHECK-NEXT: ('st_other', 0x00000000)
41 // CHECK-NEXT: ('st_shndx', 0x00000004)
42 // CHECK-NEXT: ('st_value', 0x0000000000000010)
43 // CHECK-NEXT: ('st_size', 0x0000000000000008)
44 // CHECK-NEXT: ),
46 // Test that without an explicit .local we produce a global.
47 .type common3,@object
48 .comm common3,4,4
50 // CHECK: ('st_name', 0x00000019) # 'common3'
51 // CHECK-NEXT: ('st_bind', 0x00000001)
52 // CHECK-NEXT: ('st_type', 0x00000001)
53 // CHECK-NEXT: ('st_other', 0x00000000)
54 // CHECK-NEXT: ('st_shndx', 0x0000fff2)
55 // CHECK-NEXT: ('st_value', 0x0000000000000004)
56 // CHECK-NEXT: ('st_size', 0x0000000000000004)
59 // Test that without an explicit .local we produce a global, even if the first
60 // occurrence is not in a directive.
61 .globl foo
62 .type foo,@function
63 foo:
64 movsbl common4+3(%rip), %eax
67 .type common4,@object
68 .comm common4,40,16
70 // CHECK: ('st_name', 0x00000025) # 'common4'
71 // CHECK-NEXT: ('st_bind', 0x00000001)
72 // CHECK-NEXT: ('st_type', 0x00000001)
73 // CHECK-NEXT: ('st_other', 0x00000000)
74 // CHECK-NEXT: ('st_shndx', 0x0000fff2)
75 // CHECK-NEXT: ('st_value', 0x0000000000000010)
76 // CHECK-NEXT: ('st_size', 0x0000000000000028)
78 .comm common5,4,4
80 // CHECK: # Symbol 0x00000009
81 // CHECK-NEXT: (('st_name', 0x0000002d) # 'common5'
82 // CHECK-NEXT: ('st_bind', 0x00000001)
83 // CHECK-NEXT: ('st_type', 0x00000001)
84 // CHECK-NEXT: ('st_other', 0x00000000)
85 // CHECK-NEXT: ('st_shndx', 0x0000fff2)
86 // CHECK-NEXT: ('st_value', 0x0000000000000004)
87 // CHECK-NEXT: ('st_size', 0x0000000000000004)
88 // CHECK-NEXT: ),