[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / AArch64 / label-arithmetic-diags-elf.s
blob2ef67fafb2ea59a31e58c5e87d566db551316906
1 // RUN: not llvm-mc -triple aarch64-elf -filetype=obj %s -o /dev/null 2>&1 | FileCheck %s
3 .data
4 b:
5 .fill 300
6 e:
7 .byte e - b
8 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: value evaluated as 300 is out of range.
9 // CHECK-NEXT: .byte e - b
10 // CHECK-NEXT: ^
12 .section sec_x
13 start:
14 .space 5000
15 end:
16 add w0, w1, #(end - start)
17 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: fixup value out of range
18 // CHECK-NEXT: add w0, w1, #(end - start)
19 // CHECK-NEXT: ^
21 cmp w0, #(end - start)
22 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: fixup value out of range
23 // CHECK-NEXT: cmp w0, #(end - start)
24 // CHECK-NEXT: ^
26 negative:
27 add w0, w1, #(end - negative)
28 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: fixup value out of range
29 // CHECK-NEXT: add w0, w1, #(end - negative)
30 // CHECK-NEXT: ^
32 cmp w0, #(end - negative)
33 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: fixup value out of range
34 // CHECK-NEXT: cmp w0, #(end - negative)
35 // CHECK-NEXT: ^
37 add w0, w1, #(end - external)
38 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: symbol 'external' can not be undefined in a subtraction expression
39 // CHECK-NEXT: add w0, w1, #(end - external)
40 // CHECK-NEXT: ^
42 cmp w0, #(end - external)
43 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: symbol 'external' can not be undefined in a subtraction expression
44 // CHECK-NEXT: cmp w0, #(end - external)
45 // CHECK-NEXT: ^
47 add w0, w1, #:lo12:external - end
48 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Unsupported pc-relative fixup kind
49 // CHECK-NEXT: add w0, w1, #:lo12:external - end
50 // CHECK-NEXT: ^
52 cmp w0, #:lo12:external - end
53 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Unsupported pc-relative fixup kind
54 // CHECK-NEXT: cmp w0, #:lo12:external - end
55 // CHECK-NEXT: ^
57 add w0, w1, #:got_lo12:external - end
58 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Unsupported pc-relative fixup kind
59 // CHECK-NEXT: add w0, w1, #:got_lo12:external - end
60 // CHECK-NEXT: ^
62 cmp w0, #:got_lo12:external - end
63 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Unsupported pc-relative fixup kind
64 // CHECK-NEXT: cmp w0, #:got_lo12:external - end
65 // CHECK-NEXT: ^
67 .section sec_y
68 end_across_sec:
69 add w0, w1, #(end_across_sec - start)
70 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Cannot represent a difference across sections
71 // CHECK-NEXT: add w0, w1, #(end_across_sec - start)
72 // CHECK-NEXT: ^
74 cmp w0, #(end_across_sec - start)
75 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Cannot represent a difference across sections
76 // CHECK-NEXT: cmp w0, #(end_across_sec - start)
77 // CHECK-NEXT: ^
79 add w0, w1, #(sec_y - sec_x)
80 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Cannot represent a difference across sections
81 // CHECK-NEXT: add w0, w1, #(sec_y - sec_x)
82 // CHECK-NEXT: ^
84 cmp w0, #(sec_y - sec_x)
85 // CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: Cannot represent a difference across sections
86 // CHECK-NEXT: cmp w0, #(sec_y - sec_x)
87 // CHECK-NEXT: ^