OSDN Git Service

Changed elf-dump to output hex format by default.
[android-x86/external-llvm.git] / test / MC / ELF / common.s
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump  --dump-section-data | FileCheck %s
2
3
4         .text
5
6 // Test that this produces a regular local symbol.
7         .type   common1,@object
8         .local  common1
9         .comm   common1,1,1
10
11 // CHECK: ('st_name', 0x1) # 'common1'
12 // CHECK-NEXT: ('st_bind', 0x0)
13 // CHECK-NEXT: ('st_type', 0x1)
14 // CHECK-NEXT: ('st_other', 0x0)
15 // CHECK-NEXT: ('st_shndx',
16 // CHECK-NEXT: ('st_value', 0x0)
17 // CHECK-NEXT: ('st_size', 0x1)
18
19
20 // Same as common1, but with directives in a different order.
21         .local  common2
22         .type   common2,@object
23         .comm   common2,1,1
24
25 // CHECK: ('st_name', 0x9) # 'common2'
26 // CHECK-NEXT: ('st_bind', 0x0)
27 // CHECK-NEXT: ('st_type', 0x1)
28 // CHECK-NEXT: ('st_other', 0x0)
29 // CHECK-NEXT: ('st_shndx',
30 // CHECK-NEXT: ('st_value', 0x1)
31 // CHECK-NEXT: ('st_size', 0x1)
32
33 // Test that without an explicit .local we produce a global.
34         .type   common3,@object
35         .comm   common3,4,4
36
37 // CHECK: ('st_name', 0x11) # 'common3'
38 // CHECK-NEXT: ('st_bind', 0x1)
39 // CHECK-NEXT: ('st_type', 0x1)
40 // CHECK-NEXT: ('st_other', 0x0)
41 // CHECK-NEXT: ('st_shndx', 0xfff2)
42 // CHECK-NEXT: ('st_value', 0x4)
43 // CHECK-NEXT: ('st_size', 0x4)
44
45
46 // Test that without an explicit .local we produce a global, even if the first
47 // occurrence is not in a directive.
48         .globl  foo
49         .type   foo,@function
50 foo:
51         movsbl  common4+3(%rip), %eax
52
53
54         .type   common4,@object
55         .comm   common4,40,16
56
57 // CHECK: ('st_name', 0x1d) # 'common4'
58 // CHECK-NEXT: ('st_bind', 0x1)
59 // CHECK-NEXT: ('st_type', 0x1)
60 // CHECK-NEXT: ('st_other', 0x0)
61 // CHECK-NEXT: ('st_shndx', 0xfff2)
62 // CHECK-NEXT: ('st_value', 0x10)
63 // CHECK-NEXT: ('st_size', 0x28)