xref: /aosp_15_r20/external/llvm/test/MC/ARM/comment.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker@ Tests to check that '@' does not get lexed as an identifier for arm
2*9880d681SAndroid Build Coastguard Worker@ RUN: llvm-mc %s -triple=armv7-linux-gnueabi  | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker@ RUN: llvm-mc %s -triple=armv7-linux-gnueabi 2>&1 | FileCheck %s --check-prefix=ERROR
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerfoo:
6*9880d681SAndroid Build Coastguard Worker  bl boo@plt should be ignored
7*9880d681SAndroid Build Coastguard Worker  bl goo@plt
8*9880d681SAndroid Build Coastguard Worker  .long bar@got to parse this as a comment
9*9880d681SAndroid Build Coastguard Worker  .long baz@got
10*9880d681SAndroid Build Coastguard Worker  add r0, r0@ignore this extra junk
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker@ the symver directive should allow @ in the second symbol name
13*9880d681SAndroid Build Coastguard Workerdefined1:
14*9880d681SAndroid Build Coastguard Workerdefined2:
15*9880d681SAndroid Build Coastguard Workerdefined3:
16*9880d681SAndroid Build Coastguard Workerbar:
17*9880d681SAndroid Build Coastguard Worker  .symver defined1, bar1@zed
18*9880d681SAndroid Build Coastguard Worker  .symver defined2, bar3@@zed
19*9880d681SAndroid Build Coastguard Worker  .symver defined3, bar5@@@zed
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerfar:
22*9880d681SAndroid Build Coastguard Worker  .long baz@got
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker@CHECK-LABEL: foo:
25*9880d681SAndroid Build Coastguard Worker@CHECK: bl boo
26*9880d681SAndroid Build Coastguard Worker@CHECK-NOT: @
27*9880d681SAndroid Build Coastguard Worker@CHECK: bl goo
28*9880d681SAndroid Build Coastguard Worker@CHECK-NOT: @
29*9880d681SAndroid Build Coastguard Worker@CHECK: .long bar
30*9880d681SAndroid Build Coastguard Worker@CHECK-NOT: @
31*9880d681SAndroid Build Coastguard Worker@CHECK: .long baz
32*9880d681SAndroid Build Coastguard Worker@CHECK-NOT: @
33*9880d681SAndroid Build Coastguard Worker@CHECK: add r0, r0
34*9880d681SAndroid Build Coastguard Worker@CHECK-NOT: @
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker@CHECK-LABEL: bar:
37*9880d681SAndroid Build Coastguard Worker@CHECK: bar1@zed = defined1
38*9880d681SAndroid Build Coastguard Worker@CHECK: bar3@@zed = defined2
39*9880d681SAndroid Build Coastguard Worker@CHECK: bar5@@@zed = defined3
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker@ Make sure we did not mess up the parser state and it still lexes
42*9880d681SAndroid Build Coastguard Worker@ comments correctly by excluding the @ in normal symbols
43*9880d681SAndroid Build Coastguard Worker@CHECK-LABEL: far:
44*9880d681SAndroid Build Coastguard Worker@CHECK:  .long baz
45*9880d681SAndroid Build Coastguard Worker@CHECK-NOT: @
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker@ERROR-NOT: error:
48