[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / ARM / eh-directive-personalityindex-diagnostics.s
blob2dc2c8045a65caa13331377022ec203ad88ae6cf
1 @ RUN: not llvm-mc -triple armv7-linux-eabi -filetype asm -o /dev/null %s 2>&1 \
2 @ RUN: | FileCheck %s
4 .syntax unified
5 .thumb
7 .global function
8 .type function,%function
9 .thumb_func
10 function:
11 .personalityindex 0
13 @ CHECK: error: .fnstart must precede .personalityindex directive
14 @ CHECK: .personalityindex 0
15 @ CHECK: ^
17 .global ununwindable
18 .type ununwindable,%function
19 .thumb_func
20 ununwindable:
21 .fnstart
22 .cantunwind
23 .personalityindex 0
24 .fnend
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: ^
33 .global nodata
34 .type nodata,%function
35 .thumb_func
36 nodata:
37 .fnstart
38 .handlerdata
39 .personalityindex 0
40 .fnend
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: ^
49 .global multiple_personality
50 .type multiple_personality,%function
51 .thumb_func
52 multiple_personality:
53 .fnstart
54 .personality __aeabi_personality_pr0
55 .personalityindex 0
56 .fnend
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: ^
68 .global multiple_personality_indicies
69 .type multiple_personality_indicies,%function
70 .thumb_func
71 multiple_personality_indicies:
72 .fnstart
73 .personalityindex 0
74 .personalityindex 1
75 .fnend
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: ^
87 .global invalid_expression
88 .type invalid_expression,%function
89 .thumb_func
90 invalid_expression:
91 .fnstart
92 .personalityindex <expression>
93 .fnend
95 @ CHECK: error: unknown token in expression
96 @ CHECK: .personalityindex <expression>
97 @ CHECK: ^
99 .global nonconstant_expression
100 .type nonconstant_expression,%function
101 .thumb_func
102 nonconstant_expression:
103 .fnstart
104 .personalityindex nonconstant_expression
105 .fnend
107 @ CHECK: error: index must be a constant number
108 @ CHECK: .personalityindex nonconstant_expression
109 @ CHECK: ^
111 .global bad_index
112 .type bad_index,%function
113 .thumb_func
114 bad_index:
115 .fnstart
116 .personalityindex 42
117 .fnend
119 @ CHECK: error: personality routine index should be in range [0-3]
120 @ CHECK: .personalityindex 42
121 @ CHECK: ^