68 lines · plain
1// RUN: not llvm-mc -triple armv7-apple-darwin -filetype=obj %s 2>&1 | FileCheck %s2 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 range7 b _foo1_valid+0x20000048// Check outside of range of the largest accepted positive number9_foo1:10 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range11 b _foo1+0x200000812 13// Check Same as above, for smallest negative value14_foo2_valid:15 // CHECK-NOT: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range16 b _foo2_valid-0x1FFFFF817_foo2:18 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range19 b _foo2-0x1FFFFFC20 21// Edge case - subtracting positive number22_foo3:23 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range24 b _foo3-0x200001025 26// Edge case - adding negative number27_foo4:28 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range29 b _foo4+0x200000830 31_foo5:32 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range33 bl _foo5+0x200000834 35_foo6:36 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range37 blx _foo6+0x200000838 39// blx instruction is aligned to 16-bits.40_foo7_blx:41 // CHECK-NOT:[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned42 blx _foo7_blx+0x1FFFFFE43 44// Other branch instructions require 32-bit alignment.45_foo7:46 // CHECK:[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned47 bl _foo7_blx+0x1FFFFFE48 49_foo8:50 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range51 ble _foo8+0x200000852 53_foo9:54 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation out of range55 beq _foo9+0x200000856 57 // Check that the relocation alignment is valid.58 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned59 bl _foo1+0x10160 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned61 blx _foo1+0x10162 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned63 b _foo1+0x10164 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned65 ble _foo1+0x10166 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Relocation not aligned67 beq _foo1+0x10168