Silence -Wunused-variable in release builds.
[llvm/stm8.git] / test / MC / ELF / comdat.s
blobbe7128baf4e60903b9e78c55e65b4357e53129e6
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s
3 // Test that we produce the group sections and that they are a the beginning
4 // of the file.
6 // CHECK: # Section 0x00000001
7 // CHECK-NEXT: (('sh_name', 0x0000001b) # '.group'
8 // CHECK-NEXT: ('sh_type', 0x00000011)
9 // CHECK-NEXT: ('sh_flags', 0x00000000)
10 // CHECK-NEXT: ('sh_addr', 0x00000000)
11 // CHECK-NEXT: ('sh_offset', 0x00000040)
12 // CHECK-NEXT: ('sh_size', 0x0000000c)
13 // CHECK-NEXT: ('sh_link', 0x0000000d)
14 // CHECK-NEXT: ('sh_info', 0x00000001)
15 // CHECK-NEXT: ('sh_addralign', 0x00000004)
16 // CHECK-NEXT: ('sh_entsize', 0x00000004)
17 // CHECK-NEXT: ),
18 // CHECK-NEXT: # Section 0x00000002
19 // CHECK-NEXT: (('sh_name', 0x0000001b) # '.group'
20 // CHECK-NEXT: ('sh_type', 0x00000011)
21 // CHECK-NEXT: ('sh_flags', 0x00000000)
22 // CHECK-NEXT: ('sh_addr', 0x00000000)
23 // CHECK-NEXT: ('sh_offset', 0x0000004c)
24 // CHECK-NEXT: ('sh_size', 0x00000008)
25 // CHECK-NEXT: ('sh_link', 0x0000000d)
26 // CHECK-NEXT: ('sh_info', 0x00000002)
27 // CHECK-NEXT: ('sh_addralign', 0x00000004)
28 // CHECK-NEXT: ('sh_entsize', 0x00000004)
29 // CHECK-NEXT: ),
30 // CHECK-NEXT: # Section 0x00000003
31 // CHECK-NEXT: (('sh_name', 0x0000001b) # '.group'
32 // CHECK-NEXT: ('sh_type', 0x00000011)
33 // CHECK-NEXT: ('sh_flags', 0x00000000)
34 // CHECK-NEXT: ('sh_addr', 0x00000000)
35 // CHECK-NEXT: ('sh_offset', 0x00000054)
36 // CHECK-NEXT: ('sh_size', 0x00000008)
37 // CHECK-NEXT: ('sh_link', 0x0000000d)
38 // CHECK-NEXT: ('sh_info', 0x0000000d)
39 // CHECK-NEXT: ('sh_addralign', 0x00000004)
40 // CHECK-NEXT: ('sh_entsize', 0x00000004)
41 // CHECK-NEXT: ),
43 // Test that g1 and g2 are local, but g3 is an undefined global.
45 // CHECK: # Symbol 0x00000001
46 // CHECK-NEXT: (('st_name', 0x00000001) # 'g1'
47 // CHECK-NEXT: ('st_bind', 0x00000000)
48 // CHECK-NEXT: ('st_type', 0x00000000)
49 // CHECK-NEXT: ('st_other', 0x00000000)
50 // CHECK-NEXT: ('st_shndx', 0x00000007)
51 // CHECK-NEXT: ('st_value', 0x0000000000000000)
52 // CHECK-NEXT: ('st_size', 0x0000000000000000)
53 // CHECK-NEXT: ),
54 // CHECK-NEXT: # Symbol 0x00000002
55 // CHECK-NEXT: (('st_name', 0x00000004) # 'g2'
56 // CHECK-NEXT: ('st_bind', 0x00000000)
57 // CHECK-NEXT: ('st_type', 0x00000000)
58 // CHECK-NEXT: ('st_other', 0x00000000)
59 // CHECK-NEXT: ('st_shndx', 0x00000002)
60 // CHECK-NEXT: ('st_value', 0x0000000000000000)
61 // CHECK-NEXT: ('st_size', 0x0000000000000000)
62 // CHECK-NEXT: ),
64 // CHECK: # Symbol 0x0000000d
65 // CHECK-NEXT: (('st_name', 0x00000007) # 'g3'
66 // CHECK-NEXT: ('st_bind', 0x00000001)
67 // CHECK-NEXT: ('st_type', 0x00000000)
68 // CHECK-NEXT: ('st_other', 0x00000000)
69 // CHECK-NEXT: ('st_shndx', 0x00000000)
70 // CHECK-NEXT: ('st_value', 0x0000000000000000)
71 // CHECK-NEXT: ('st_size', 0x0000000000000000)
72 // CHECK-NEXT: ),
75 .section .foo,"axG",@progbits,g1,comdat
76 g1:
77 nop
79 .section .bar,"axG",@progbits,g1,comdat
80 nop
82 .section .zed,"axG",@progbits,g2,comdat
83 nop
85 .section .baz,"axG",@progbits,g3,comdat
86 .long g3