[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / ARM / thumb2-branch-ranges.s
blob6f537d85b44988e97571cac6d8d086813e39ce68
1 @ RUN: not llvm-mc %s -triple thumbv7-linux-gnueabi -filetype=obj -o /dev/null 2>&1 | FileCheck %s
3 // Thumb2 unconditional branch has a range of +- 16 Megabytes. The
4 // conditional branch has a range of +- 1 Megabyte. We should give
5 // an error message if we evaluate the expression at assembly
6 // time and it is out of range.
8 .syntax unified
9 .thumb
10 b.w end
11 .space 0xfffffe
12 end:
13 b.w end2
14 .space 0xfffffe
15 .global end2
16 end2:
18 // branch to arm function uses relocation
19 b.w end3
20 .space 0x1000000
21 .global end3
22 .type end3, %function
23 .arm
24 end3: bx lr
25 .thumb
27 // branch to thumb function is resolved at assembly time
28 // CHECK-NOT: error
29 // CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
30 // CHECK-LABEL: b.w end4
31 b.w end4
32 .space 0x1000000
33 .thumb_func
34 end4:
36 beq.w end5
37 .space 0xffffc
38 end5:
40 // conditional branch to arm function uses relocation
41 beq.w end6
42 .arm
43 .type end6, %function
44 .space 0x100000
45 end6: bx lr
46 .thumb
48 // conditional branch to thumb function resolved at assembly time
49 // CHECK-NOT: error
50 // CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
51 // CHECK-LABEL: beq.w end7
52 beq.w end7
53 .space 0x100000
54 end7:
56 start:
57 .space 0xfffffc
58 b.w start
60 .arm
61 .global start2
62 .type start2, %function
63 start2:
64 .space 0x1000000
65 .thumb
66 // branch to arm function uses relocation
67 b.w start2
69 start3:
70 .space 0x1000000
71 // branch to thumb function resolved at assembly time
72 // CHECK-NOT: error
73 // CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
74 // CHECK-LABEL: b.w start3
75 b.w start3
77 start4:
78 .space 0xffffc
79 b.w start4
81 .arm
82 .global start5
83 .type start5, %function
84 start5:
85 .space 0x100000
86 .thumb
87 // conditional branch to arm function uses relocation
88 beq.w start5
90 start6:
91 .space 0x100000
92 // branch to thumb function resolved at assembly time
93 // CHECK-NOT: error
94 // CHECK: [[@LINE+2]]:{{[0-9]}}: error: Relocation out of range
95 // CHECK-LABEL: beq.w start6
96 beq.w start6