xref: /aosp_15_r20/external/llvm/test/MC/AArch64/error-location.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: not llvm-mc -triple aarch64--none-eabi -filetype obj < %s -o /dev/null 2>&1 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker// Note: These errors are not always emitted in the order in which the relevant
4*9880d681SAndroid Build Coastguard Worker// source appears, this file is carefully ordered so that that is the case.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker  .text
7*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: symbol 'undef' can not be undefined in a subtraction expression
8*9880d681SAndroid Build Coastguard Worker  .word (0-undef)
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: expected relocatable expression
11*9880d681SAndroid Build Coastguard Worker  .word -undef
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: No relocation available to represent this relative expression
14*9880d681SAndroid Build Coastguard Worker  adr x0, #a-undef
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Cannot represent a difference across sections
17*9880d681SAndroid Build Coastguard Worker  .word x_a - y_a
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: 1-byte data relocations not supported
20*9880d681SAndroid Build Coastguard Worker  .byte undef
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: 1-byte data relocations not supported
23*9880d681SAndroid Build Coastguard Worker  .byte undef-.
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Unsupported pc-relative fixup kind
26*9880d681SAndroid Build Coastguard Worker  ldr x0, [x1, :lo12:undef-.]
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: invalid fixup for 8-bit load/store instruction
29*9880d681SAndroid Build Coastguard Worker  ldrb w0, [x1, :gottprel_lo12:undef]
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: invalid fixup for 16-bit load/store instruction
32*9880d681SAndroid Build Coastguard Worker  ldrh w0, [x1, :gottprel_lo12:undef]
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: invalid fixup for 32-bit load/store instruction
35*9880d681SAndroid Build Coastguard Worker  ldr w0, [x1, :gottprel_lo12:undef]
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker// CHECK: <unknown>:0: error: expression could not be evaluated
38*9880d681SAndroid Build Coastguard Worker  .set v1, -undef
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Worker  .comm common, 4
41*9880d681SAndroid Build Coastguard Worker// CHECK: <unknown>:0: error: Common symbol 'common' cannot be used in assignment expr
42*9880d681SAndroid Build Coastguard Worker  .set v3, common
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Worker// CHECK: <unknown>:0: error: symbol 'undef' could not be evaluated in a subtraction expression
45*9880d681SAndroid Build Coastguard Worker  .set v2, a-undef
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard Workerw:
50*9880d681SAndroid Build Coastguard Worker  .word 0
51*9880d681SAndroid Build Coastguard Worker  .weak w
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Worker  .section sec_x
55*9880d681SAndroid Build Coastguard Workerx_a:
56*9880d681SAndroid Build Coastguard Worker  .word 0
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Worker  .section sec_y
60*9880d681SAndroid Build Coastguard Workery_a:
61*9880d681SAndroid Build Coastguard Worker  .word 0
62