blob: 5abacc70135471f24ce933f50c45661045fc9a8c [file] [log] [blame]
Rafael Espindola7768a9d2011-02-16 01:08:29 +00001# RUN: llvm-mc -triple i386-pc-linux-gnu -filetype=obj -o %t %s
2# RUN: elf-dump --dump-section-data < %t | FileCheck %s
3.section test1
4.byte 1
5.section test2
6.byte 2
7.previous
8.byte 1
9.section test2
10.byte 2
11.previous
12.byte 1
13.section test1
14.byte 1
15.previous
16.byte 1
17.section test2
18.byte 2
19.pushsection test3
20.byte 3
21.pushsection test4
22.byte 4
23.pushsection test5
24.byte 5
25.popsection
26.byte 4
27.popsection
28.byte 3
29.popsection
30.byte 2
31.pushsection test3
32.byte 3
33.pushsection test4
34.byte 4
35.previous
36.byte 3
37.popsection
38.byte 3
39.previous
40.byte 2
41.section test1
42.byte 1
43.popsection
44.byte 2
45.previous
46.byte 1
47.previous
Rafael Espindola9974b8b2011-04-07 23:51:25 +000048# CHECK: (('sh_name', 0x00000044) # 'test1'
Rafael Espindola7768a9d2011-02-16 01:08:29 +000049# CHECK-NEXT: ('sh_type', 0x00000001)
50# CHECK-NEXT: ('sh_flags', 0x00000000)
51# CHECK-NEXT: ('sh_addr', 0x00000000)
52# CHECK-NEXT: ('sh_offset', 0x00000034)
53# CHECK-NEXT: ('sh_size', 0x00000007)
54# CHECK-NEXT: ('sh_link', 0x00000000)
55# CHECK-NEXT: ('sh_info', 0x00000000)
56# CHECK-NEXT: ('sh_addralign', 0x00000001)
57# CHECK-NEXT: ('sh_entsize', 0x00000000)
58# CHECK-NEXT: ('_section_data', '01010101 010101')
59# CHECK-NEXT: ),
Rafael Espindola9974b8b2011-04-07 23:51:25 +000060# CHECK: (('sh_name', 0x0000003e) # 'test2'
Rafael Espindola7768a9d2011-02-16 01:08:29 +000061# CHECK-NEXT: ('sh_type', 0x00000001)
62# CHECK-NEXT: ('sh_flags', 0x00000000)
63# CHECK-NEXT: ('sh_addr', 0x00000000)
64# CHECK-NEXT: ('sh_offset', 0x0000003b)
65# CHECK-NEXT: ('sh_size', 0x00000006)
66# CHECK-NEXT: ('sh_link', 0x00000000)
67# CHECK-NEXT: ('sh_info', 0x00000000)
68# CHECK-NEXT: ('sh_addralign', 0x00000001)
69# CHECK-NEXT: ('sh_entsize', 0x00000000)
70# CHECK-NEXT: ('_section_data', '02020202 0202')
71# CHECK-NEXT: ),
Rafael Espindola9974b8b2011-04-07 23:51:25 +000072# CHECK: (('sh_name', 0x00000038) # 'test3'
Rafael Espindola7768a9d2011-02-16 01:08:29 +000073# CHECK-NEXT: ('sh_type', 0x00000001)
74# CHECK-NEXT: ('sh_flags', 0x00000000)
75# CHECK-NEXT: ('sh_addr', 0x00000000)
76# CHECK-NEXT: ('sh_offset', 0x00000041)
77# CHECK-NEXT: ('sh_size', 0x00000005)
78# CHECK-NEXT: ('sh_link', 0x00000000)
79# CHECK-NEXT: ('sh_info', 0x00000000)
80# CHECK-NEXT: ('sh_addralign', 0x00000001)
81# CHECK-NEXT: ('sh_entsize', 0x00000000)
82# CHECK-NEXT: ('_section_data', '03030303 03')
83# CHECK-NEXT: ),
Rafael Espindola9974b8b2011-04-07 23:51:25 +000084# CHECK: (('sh_name', 0x00000032) # 'test4'
Rafael Espindola7768a9d2011-02-16 01:08:29 +000085# CHECK-NEXT: ('sh_type', 0x00000001)
86# CHECK-NEXT: ('sh_flags', 0x00000000)
87# CHECK-NEXT: ('sh_addr', 0x00000000)
88# CHECK-NEXT: ('sh_offset', 0x00000046)
89# CHECK-NEXT: ('sh_size', 0x00000003)
90# CHECK-NEXT: ('sh_link', 0x00000000)
91# CHECK-NEXT: ('sh_info', 0x00000000)
92# CHECK-NEXT: ('sh_addralign', 0x00000001)
93# CHECK-NEXT: ('sh_entsize', 0x00000000)
94# CHECK-NEXT: ('_section_data', '040404')
95# CHECK-NEXT: ),
Rafael Espindola9974b8b2011-04-07 23:51:25 +000096# CHECK: (('sh_name', 0x0000002c) # 'test5'
Rafael Espindola7768a9d2011-02-16 01:08:29 +000097# CHECK-NEXT: ('sh_type', 0x00000001)
98# CHECK-NEXT: ('sh_flags', 0x00000000)
99# CHECK-NEXT: ('sh_addr', 0x00000000)
100# CHECK-NEXT: ('sh_offset', 0x00000049)
101# CHECK-NEXT: ('sh_size', 0x00000001)
102# CHECK-NEXT: ('sh_link', 0x00000000)
103# CHECK-NEXT: ('sh_info', 0x00000000)
104# CHECK-NEXT: ('sh_addralign', 0x00000001)
105# CHECK-NEXT: ('sh_entsize', 0x00000000)
106# CHECK-NEXT: ('_section_data', '05')
107# CHECK-NEXT: ),