1@ RUN: not llvm-mc -triple armv7-linux-eabi -filetype asm -o /dev/null %s 2>&1  \
2@ RUN:   | FileCheck %s
3
4	.syntax unified
5	.thumb
6
7	.global function
8	.type function,%function
9	.thumb_func
10function:
11	.personalityindex 0
12
13@ CHECK: error: .fnstart must precede .personalityindex directive
14@ CHECK: 	.personalityindex 0
15@ CHECK:        ^
16
17	.global ununwindable
18	.type ununwindable,%function
19	.thumb_func
20ununwindable:
21	.fnstart
22	.cantunwind
23	.personalityindex 0
24	.fnend
25
26@ CHECK: error: .personalityindex cannot be used with .cantunwind
27@ CHECK: 	.personalityindex 0
28@ CHECK:        ^
29@ CHECK: note: .cantunwind was specified here
30@ CHECK: 	.cantunwind
31@ CHECK:        ^
32
33	.global nodata
34	.type nodata,%function
35	.thumb_func
36nodata:
37	.fnstart
38	.handlerdata
39	.personalityindex 0
40	.fnend
41
42@ CHECK: error: .personalityindex must precede .handlerdata directive
43@ CHECK: 	.personalityindex 0
44@ CHECK:        ^
45@ CHECK: note: .handlerdata was specified here
46@ CHECK: 	.handlerdata
47@ CHECK:        ^
48
49	.global multiple_personality
50	.type multiple_personality,%function
51	.thumb_func
52multiple_personality:
53	.fnstart
54	.personality __aeabi_personality_pr0
55	.personalityindex 0
56	.fnend
57
58@ CHECK: error: multiple personality directives
59@ CHECK: 	.personalityindex 0
60@ CHECK:        ^
61@ CHECK: note: .personality was specified here
62@ CHECK: 	.personality __aeabi_personality_pr0
63@ CHECK:        ^
64@ CHECK: note: .personalityindex was specified here
65@ CHECK: 	.personalityindex 0
66@ CHECK:       ^
67
68	.global multiple_personality_indicies
69	.type multiple_personality_indicies,%function
70	.thumb_func
71multiple_personality_indicies:
72	.fnstart
73	.personalityindex 0
74	.personalityindex 1
75	.fnend
76
77@ CHECK: error: multiple personality directives
78@ CHECK: 	.personalityindex 1
79@ CHECK:        ^
80@ CHECK: note: .personalityindex was specified here
81@ CHECK: 	.personalityindex 0
82@ CHECK:        ^
83@ CHECK: note: .personalityindex was specified here
84@ CHECK: 	.personalityindex 1
85@ CHECK:        ^
86
87	.global invalid_expression
88	.type invalid_expression,%function
89	.thumb_func
90invalid_expression:
91	.fnstart
92	.personalityindex <expression>
93	.fnend
94
95@ CHECK: error: unknown token in expression
96@ CHECK: 	.personalityindex <expression>
97@ CHECK:                          ^
98
99	.global nonconstant_expression
100	.type nonconstant_expression,%function
101	.thumb_func
102nonconstant_expression:
103	.fnstart
104	.personalityindex nonconstant_expression
105	.fnend
106
107@ CHECK: error: index must be a constant number
108@ CHECK: 	.personalityindex nonconstant_expression
109@ CHECK:                          ^
110
111	.global bad_index
112	.type bad_index,%function
113	.thumb_func
114bad_index:
115	.fnstart
116	.personalityindex 42
117	.fnend
118
119@ CHECK: error: personality routine index should be in range [0-3]
120@ CHECK: 	.personalityindex 42
121@ CHECK:                          ^
122
123