xref: /aosp_15_r20/external/llvm/test/MC/AArch64/arm64-directive_loh.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# RUN: not llvm-mc -triple arm64-apple-darwin < %s 2> %t | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker# RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker.globl _fct1
5*9880d681SAndroid Build Coastguard Worker_fct1:
6*9880d681SAndroid Build Coastguard Worker  L1:
7*9880d681SAndroid Build Coastguard Worker  L2:
8*9880d681SAndroid Build Coastguard Worker  L3:
9*9880d681SAndroid Build Coastguard Worker  L4:
10*9880d681SAndroid Build Coastguard Worker  ret lr;
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker# Known LOHs with:
13*9880d681SAndroid Build Coastguard Worker# - Regular syntax.
14*9880d681SAndroid Build Coastguard Worker# - Alternative syntax.
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAdrp L1, L2
17*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAdrp L1, L2
18*9880d681SAndroid Build Coastguard Worker.loh AdrpAdrp L1, L2
19*9880d681SAndroid Build Coastguard Worker.loh 1 L1, L2
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdr L1, L2
22*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdr L1, L2
23*9880d681SAndroid Build Coastguard Worker.loh AdrpLdr L1, L2
24*9880d681SAndroid Build Coastguard Worker.loh 2 L1, L2
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAddLdr L1, L2, L3
27*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAddLdr L1, L2, L3
28*9880d681SAndroid Build Coastguard Worker.loh AdrpAddLdr L1, L2, L3
29*9880d681SAndroid Build Coastguard Worker.loh 3 L1, L2, L3
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdrGotLdr L1, L2, L3
32*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdrGotLdr L1, L2, L3
33*9880d681SAndroid Build Coastguard Worker.loh AdrpLdrGotLdr L1, L2, L3
34*9880d681SAndroid Build Coastguard Worker.loh 4 L1, L2, L3
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAddStr L1, L2, L3
37*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAddStr L1, L2, L3
38*9880d681SAndroid Build Coastguard Worker.loh AdrpAddStr L1, L2, L3
39*9880d681SAndroid Build Coastguard Worker.loh 5 L1, L2, L3
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdrGotStr L1, L2, L3
42*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdrGotStr L1, L2, L3
43*9880d681SAndroid Build Coastguard Worker.loh AdrpLdrGotStr L1, L2, L3
44*9880d681SAndroid Build Coastguard Worker.loh 6 L1, L2, L3
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAdd L1, L2
47*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpAdd L1, L2
48*9880d681SAndroid Build Coastguard Worker.loh AdrpAdd L1, L2
49*9880d681SAndroid Build Coastguard Worker.loh 7 L1, L2
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdrGot L1, L2
52*9880d681SAndroid Build Coastguard Worker# CHECK: .loh AdrpLdrGot L1, L2
53*9880d681SAndroid Build Coastguard Worker.loh AdrpLdrGot L1, L2
54*9880d681SAndroid Build Coastguard Worker.loh 8 L1, L2
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Worker# End Known LOHs.
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard Worker### Errors Check ####
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker# Unknown textual identifier.
61*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS: error: invalid identifier in directive
62*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT: .loh Unknown
63*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT:      ^
64*9880d681SAndroid Build Coastguard Worker.loh Unknown
65*9880d681SAndroid Build Coastguard Worker# Unknown numeric identifier.
66*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS: error: invalid numeric identifier in directive
67*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT: .loh 153, L1
68*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT:      ^
69*9880d681SAndroid Build Coastguard Worker.loh 153, L1
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard Worker# Too much arguments.
72*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS: error: unexpected token in '.loh' directive
73*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT: .loh AdrpAdrp L1, L2, L3
74*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT:                     ^
75*9880d681SAndroid Build Coastguard Worker.loh AdrpAdrp L1, L2, L3
76*9880d681SAndroid Build Coastguard Worker
77*9880d681SAndroid Build Coastguard Worker# Too much arguments with alternative syntax.
78*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS: error: unexpected token in '.loh' directive
79*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT: .loh 1 L1, L2, L3
80*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT:              ^
81*9880d681SAndroid Build Coastguard Worker.loh 1 L1, L2, L3
82*9880d681SAndroid Build Coastguard Worker
83*9880d681SAndroid Build Coastguard Worker# Too few argumets.
84*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS: error: unexpected token in '.loh' directive
85*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT: .loh AdrpAdrp L1
86*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT:                 ^
87*9880d681SAndroid Build Coastguard Worker.loh AdrpAdrp L1
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard Worker# Too few argumets with alternative syntax.
90*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS: error: unexpected token in '.loh' directive
91*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT: .loh 1 L1
92*9880d681SAndroid Build Coastguard Worker# CHECK-ERRORS-NEXT:          ^
93*9880d681SAndroid Build Coastguard Worker.loh 1 L1
94