error-location.s revision f3ef5332fa3f4d5ec72c178a2b19dac363a19383
1// RUN: not llvm-mc -triple aarch64--none-eabi -filetype obj < %s -o /dev/null 2>&1 | FileCheck %s
2
3// Note: These errors are not always emitted in the order in which the relevant
4// source appears, this file is carefully ordered so that that is the case.
5
6  .text
7// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: symbol 'undef' can not be undefined in a subtraction expression
8  .word (0-undef)
9
10// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: expected relocatable expression
11  .word -undef
12
13// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: No relocation available to represent this relative expression
14  adr x0, #a-undef
15
16// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Cannot represent a difference across sections
17  .word x_a - y_a
18
19// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Cannot represent a subtraction with a weak symbol
20  .word a - w
21
22// CHECK: <unknown>:0: error: expression could not be evaluated
23  .set v1, -undef
24
25  .comm common, 4
26// CHECK: <unknown>:0: error: Common symbol 'common' cannot be used in assignment expr
27  .set v3, common
28
29// CHECK: <unknown>:0: error: Undefined temporary symbol
30  .word 5f
31
32// CHECK: <unknown>:0: error: symbol 'undef' could not be evaluated in a subtraction expression
33  .set v2, a-undef
34
35
36
37w:
38  .word 0
39  .weak w
40
41
42  .section sec_x
43x_a:
44  .word 0
45
46
47  .section sec_y
48y_a:
49  .word 0
50