[Frontend] Remove unused includes (NFC) (#116927)
[llvm-project.git] / llvm / test / MC / ARM / macho-relocs-with-addend-invalid.s
blob4ecb73814dfac69e1878fddc231a679d23c4668b
1 // RUN: not llvm-mc -triple armv7-apple-darwin -filetype=obj %s 2>&1 | FileCheck %s
3 // Check that the relocation size is valid.
4 // Check lower bound of edge case.
5 _foo1_valid:
6 // CHECK-NOT: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
7 b _foo1_valid+0x2000004
8 // Check outside of range of the largest accepted positive number
9 _foo1:
10 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
11 b _foo1+0x2000008
13 // Check Same as above, for smallest negative value
14 _foo2_valid:
15 // CHECK-NOT: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
16 b _foo2_valid-0x1FFFFF8
17 _foo2:
18 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
19 b _foo2-0x1FFFFFC
21 // Edge case - subtracting positive number
22 _foo3:
23 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
24 b _foo3-0x2000010
26 // Edge case - adding negative number
27 _foo4:
28 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
29 b _foo4+0x2000008
31 _foo5:
32 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
33 bl _foo5+0x2000008
35 _foo6:
36 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
37 blx _foo6+0x2000008
39 // blx instruction is aligned to 16-bits.
40 _foo7_blx:
41 // CHECK-NOT:[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned
42 blx _foo7_blx+0x1FFFFFE
44 // Other branch instructions require 32-bit alignment.
45 _foo7:
46 // CHECK:[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned
47 bl _foo7_blx+0x1FFFFFE
49 _foo8:
50 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
51 ble _foo8+0x2000008
53 _foo9:
54 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range
55 beq _foo9+0x2000008
57 // Check that the relocation alignment is valid.
58 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned
59 bl _foo1+0x101
60 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned
61 blx _foo1+0x101
62 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned
63 b _foo1+0x101
64 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned
65 ble _foo1+0x101
66 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned
67 beq _foo1+0x101