Merging r259798, r259835:
[oota-llvm.git] / test / MC / ARM / eh-directive-cantunwind-diagnostics.s
1 @ RUN: not llvm-mc -triple=armv7-unknown-linux-gnueabi < %s 2> %t
2 @ RUN: FileCheck < %t %s
3
4 @ Check the diagnostics for .cantunwind, .handlerdata, and .personality
5
6 @ .cantunwind directive can't be used with .handlerdata directive nor
7 @ .personality directive.  This test case check for the diagnostics for
8 @ the conflicts.
9
10
11         .syntax unified
12         .text
13
14 @-------------------------------------------------------------------------------
15 @ TEST1: cantunwind + personality
16 @-------------------------------------------------------------------------------
17         .globl  func1
18         .align  2
19         .type   func1,%function
20         .fnstart
21 func1:
22         .cantunwind
23         .personality    __gxx_personality_v0
24 @ CHECK: error: .personality can't be used with .cantunwind directive
25 @ CHECK:        .personality __gxx_personality_v0
26 @ CHECK:        ^
27 @ CHECK: note: .cantunwind was specified here
28 @ CHECK:        .cantunwind
29 @ CHECK:        ^
30         .fnend
31
32
33
34 @-------------------------------------------------------------------------------
35 @ TEST2: cantunwind + handlerdata
36 @-------------------------------------------------------------------------------
37         .globl  func2
38         .align  2
39         .type   func2,%function
40         .fnstart
41 func2:
42         .cantunwind
43         .handlerdata
44 @ CHECK: error: .handlerdata can't be used with .cantunwind directive
45 @ CHECK:        .handlerdata
46 @ CHECK:        ^
47 @ CHECK: note: .cantunwind was specified here
48 @ CHECK:        .cantunwind
49 @ CHECK:        ^
50         .fnend
51
52
53
54 @-------------------------------------------------------------------------------
55 @ TEST3: personality + cantunwind
56 @-------------------------------------------------------------------------------
57         .globl  func3
58         .align  2
59         .type   func3,%function
60         .fnstart
61 func3:
62         .personality    __gxx_personality_v0
63         .cantunwind
64 @ CHECK: error: .cantunwind can't be used with .personality directive
65 @ CHECK:        .cantunwind
66 @ CHECK:        ^
67 @ CHECK: note: .personality was specified here
68 @ CHECK:        .personality __gxx_personality_v0
69 @ CHECK:        ^
70         .fnend
71
72
73
74 @-------------------------------------------------------------------------------
75 @ TEST4: handlerdata + cantunwind
76 @-------------------------------------------------------------------------------
77         .globl  func4
78         .align  2
79         .type   func4,%function
80         .fnstart
81 func4:
82         .handlerdata
83         .cantunwind
84 @ CHECK: error: .cantunwind can't be used with .handlerdata directive
85 @ CHECK:        .cantunwind
86 @ CHECK:        ^
87 @ CHECK: note: .handlerdata was specified here
88 @ CHECK:        .handlerdata
89 @ CHECK:        ^
90         .fnend
91
92
93
94 @-------------------------------------------------------------------------------
95 @ TEST5: cantunwind + fnstart
96 @-------------------------------------------------------------------------------
97         .globl  func5
98         .align  2
99         .type   func5,%function
100         .cantunwind
101 @ CHECK: error: .fnstart must precede .cantunwind directive
102 @ CHECK:        .cantunwind
103 @ CHECK:        ^
104         .fnstart
105 func5:
106         .fnend