Fix ARM FastISel tests, as a first step to enabling ARM FastISel
[oota-llvm.git] / test / MC / ARM / eh-directive-section.s
1 @ RUN: llvm-mc %s -triple=armv7-unknown-linux-gnueabi -filetype=obj -o - \
2 @ RUN:   | llvm-readobj -s -sd -sr -t | FileCheck %s
3
4 @ Check the combination of .section, .fnstart, and .fnend directives.
5
6 @ For the functions in .text section, the exception handling index (EXIDX)
7 @ should be generated in .ARM.exidx, and the exception handling table (EXTAB)
8 @ should be generated in .ARM.extab.
9
10 @ For the functions in custom section specified by .section directives,
11 @ the EXIDX should be generated in ".ARM.exidx[[SECTION_NAME]]", and the EXTAB
12 @ should be generated in ".ARM.extab[[SECTION_NAME]]".
13
14         .syntax unified
15
16 @-------------------------------------------------------------------------------
17 @ .TEST1 section
18 @-------------------------------------------------------------------------------
19         .section        .TEST1
20         .globl  func1
21         .align  2
22         .type   func1,%function
23         .fnstart
24 func1:
25         bx      lr
26         .personality    __gxx_personality_v0
27         .handlerdata
28         .fnend
29
30
31 @-------------------------------------------------------------------------------
32 @ TEST2 section (without the dot in the beginning)
33 @-------------------------------------------------------------------------------
34         .section        TEST2
35         .globl  func2
36         .align  2
37         .type   func2,%function
38         .fnstart
39 func2:
40         bx      lr
41         .personality    __gxx_personality_v0
42         .handlerdata
43         .fnend
44
45
46 @-------------------------------------------------------------------------------
47 @ Check the .TEST1 section.
48 @-------------------------------------------------------------------------------
49 @ CHECK: Sections [
50 @ CHECK:   Section {
51 @ CHECK:     Index: 4
52 @ CHECK:     Name: .TEST1
53 @ CHECK:     SectionData (
54 @ CHECK:       0000: 1EFF2FE1                             |../.|
55 @ CHECK:     )
56 @ CHECK:   }
57
58 @-------------------------------------------------------------------------------
59 @ Check the .ARM.extab.TEST1 section, the EXTAB of .TEST1 section.
60 @-------------------------------------------------------------------------------
61 @ CHECK:   Section {
62 @ CHECK:     Name: .ARM.extab.TEST1
63 @ CHECK:     Relocations [
64 @ CHECK:       0x0 R_ARM_PREL31 __gxx_personality_v0 0x0
65 @ CHECK:     ]
66 @ CHECK:     SectionData (
67 @ CHECK:       0000: 00000000 B0B0B000                    |........|
68 @ CHECK:     )
69 @ CHECK:   }
70
71
72 @-------------------------------------------------------------------------------
73 @ Check the.ARM.exidx.TEST1 section, the EXIDX of .TEST1 section.
74 @-------------------------------------------------------------------------------
75 @ CHECK:   Section {
76 @ CHECK:     Name: .ARM.exidx.TEST1
77
78 @-------------------------------------------------------------------------------
79 @ This section should linked with .TEST1 section.
80 @-------------------------------------------------------------------------------
81 @ CHECK:     Link: 4
82
83 @-------------------------------------------------------------------------------
84 @ The first word should be relocated to the code address in .TEST1 section.
85 @ The second word should be relocated to the EHTAB entry in .ARM.extab.TEST1
86 @ section.
87 @-------------------------------------------------------------------------------
88 @ CHECK:     Relocations [
89 @ CHECK:       0x0 R_ARM_PREL31 .TEST1 0x0
90 @ CHECK:       0x4 R_ARM_PREL31 .ARM.extab.TEST1 0x0
91 @ CHECK:     ]
92 @ CHECK:     SectionData (
93 @ CHECK:       0000: 00000000 00000000                    |........|
94 @ CHECK:     )
95 @ CHECK:   }
96
97
98
99 @-------------------------------------------------------------------------------
100 @ Check the TEST2 section (without the dot in the beginning)
101 @-------------------------------------------------------------------------------
102 @ CHECK:   Section {
103 @ CHECK:     Index: 9
104 @ CHECK:     Name: TEST2
105 @ CHECK:     SectionData (
106 @ CHECK:       0000: 1EFF2FE1                             |../.|
107 @ CHECK:     )
108 @ CHECK:   }
109
110 @-------------------------------------------------------------------------------
111 @ Check the .ARM.extabTEST2 section, the EXTAB of TEST2 section.
112 @-------------------------------------------------------------------------------
113 @ CHECK:   Section {
114 @ CHECK:     Name: .ARM.extabTEST2
115 @ CHECK:     Relocations [
116 @ CHECK:       0x0 R_ARM_PREL31 __gxx_personality_v0 0x0
117 @ CHECK:     ]
118 @ CHECK:     SectionData (
119 @ CHECK:       0000: 00000000 B0B0B000                    |........|
120 @ CHECK:     )
121 @ CHECK:   }
122
123
124 @-------------------------------------------------------------------------------
125 @ Check the .ARM.exidxTEST2 section, the EXIDX of TEST2 section.
126 @-------------------------------------------------------------------------------
127 @ CHECK:   Section {
128 @ CHECK:     Name: .ARM.exidxTEST2
129
130 @-------------------------------------------------------------------------------
131 @ This section should linked with TEST2 section.
132 @-------------------------------------------------------------------------------
133 @ CHECK:     Link: 9
134
135 @-------------------------------------------------------------------------------
136 @ The first word should be relocated to the code address in TEST2 section.
137 @ The second word should be relocated to the EHTAB entry in .ARM.extabTEST2
138 @ section.
139 @-------------------------------------------------------------------------------
140 @ CHECK:     Relocations [
141 @ CHECK:       0x0 R_ARM_PREL31 TEST2 0x0
142 @ CHECK:       0x4 R_ARM_PREL31 .ARM.extabTEST2 0x0
143 @ CHECK:     ]
144 @ CHECK:     SectionData (
145 @ CHECK:       0000: 00000000 00000000                    |........|
146 @ CHECK:     )
147 @ CHECK:   }
148 @ CHECK: ]
149
150
151
152 @-------------------------------------------------------------------------------
153 @ Check the symbols and the sections they belong to
154 @-------------------------------------------------------------------------------
155 @ CHECK: Symbols [
156 @ CHECK:   Symbol {
157 @ CHECK:     Name: func1
158 @ CHECK:     Section: .TEST1 (0x4)
159 @ CHECK:   }
160 @ CHECK:   Symbol {
161 @ CHECK:     Name: func2
162 @ CHECK:     Section: TEST2 (0x9)
163 @ CHECK:   }
164 @ CHECK: ]