[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / ARM / eh-directive-setfp-diagnostics.s
blob384422c09247568411942e07b0b056a522a10e90
1 @ RUN: not llvm-mc -triple=armv7-unknown-linux-gnueabi < %s 2> %t
2 @ RUN: FileCheck < %t %s
4 @ Check the diagnostics for .setfp directive.
7 .syntax unified
8 .text
10 @-------------------------------------------------------------------------------
11 @ TEST1: .setfp before .fnstart
12 @-------------------------------------------------------------------------------
13 .globl func1
14 .align 2
15 .type func1,%function
16 .setfp fp, sp, #0
17 @ CHECK: error: .fnstart must precede .setfp directive
18 @ CHECK: .setfp fp, sp, #0
19 @ CHECK: ^
20 .fnstart
21 func1:
22 .fnend
26 @-------------------------------------------------------------------------------
27 @ TEST2: .setfp after .handlerdata
28 @-------------------------------------------------------------------------------
29 .globl func2
30 .align 2
31 .type func2,%function
32 .fnstart
33 func2:
34 .handlerdata
35 .setfp fp, sp, #0
36 @ CHECK: error: .setfp must precede .handlerdata directive
37 @ CHECK: .setfp fp, sp, #0
38 @ CHECK: ^
39 .fnend
43 @-------------------------------------------------------------------------------
44 @ TEST3: .setfp with bad fp register
45 @-------------------------------------------------------------------------------
46 .globl func3
47 .align 2
48 .type func3,%function
49 .fnstart
50 func3:
51 .setfp 0, r0, #0
52 @ CHECK: error: frame pointer register expected
53 @ CHECK: .setfp 0, r0, #0
54 @ CHECK: ^
55 .fnend
59 @-------------------------------------------------------------------------------
60 @ TEST4: .setfp with bad sp register
61 @-------------------------------------------------------------------------------
62 .globl func4
63 .align 2
64 .type func4,%function
65 .fnstart
66 func4:
67 .setfp fp, 0, #0
68 @ CHECK: error: stack pointer register expected
69 @ CHECK: .setfp fp, 0, #0
70 @ CHECK: ^
71 .fnend
75 @-------------------------------------------------------------------------------
76 @ TEST5: .setfp with non-sp register as second operand
77 @-------------------------------------------------------------------------------
78 .globl func5
79 .align 2
80 .type func5,%function
81 .fnstart
82 func5:
83 .setfp fp, r0, #0
84 @ CHECK: error: register should be either $sp or the latest fp register
85 @ CHECK: .setfp fp, r0, #0
86 @ CHECK: ^
87 .fnend