Skip to content

Commit 35b84be

Browse files
committed
Precommit test
1 parent 34e15ad commit 35b84be

File tree

2 files changed

+1945
-1000
lines changed

2 files changed

+1945
-1000
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; integrated-as fails with error: unexpected token
3+
; sw zero, %lo(eg)(a0) \n sw zero, %lo(eg)(a0)
4+
; ^
5+
; RUN: llc -mtriple=riscv32 -verify-machineinstrs -no-integrated-as < %s \
6+
; RUN: | FileCheck -check-prefixes=RV32I %s
7+
; RUN: llc -mtriple=riscv64 -verify-machineinstrs -no-integrated-as < %s \
8+
; RUN: | FileCheck -check-prefixes=RV64I %s
9+
; RUN: llc -mtriple=riscv32 -code-model=medium -verify-machineinstrs -no-integrated-as < %s \
10+
; RUN: | FileCheck -check-prefixes=RV32I-MEDIUM %s
11+
; RUN: llc -mtriple=riscv64 -code-model=medium -verify-machineinstrs -no-integrated-as < %s \
12+
; RUN: | FileCheck -check-prefixes=RV64I-MEDIUM %s
13+
14+
@eg = external global [4000 x i32], align 4
15+
@ewg = extern_weak global [4000 x i32], align 4
16+
17+
define void @constraint_o_with_multi_operands() nounwind {
18+
; RV32I-LABEL: constraint_o_with_multi_operands:
19+
; RV32I: # %bb.0:
20+
; RV32I-NEXT: lui a0, %hi(eg)
21+
; RV32I-NEXT: #APP
22+
; RV32I-NEXT: sw zero, %lo(eg)(a0) \n sw zero, %lo(eg)(a0)
23+
; RV32I-NEXT: #NO_APP
24+
; RV32I-NEXT: ret
25+
;
26+
; RV64I-LABEL: constraint_o_with_multi_operands:
27+
; RV64I: # %bb.0:
28+
; RV64I-NEXT: lui a0, %hi(eg)
29+
; RV64I-NEXT: #APP
30+
; RV64I-NEXT: sw zero, %lo(eg)(a0) \n sw zero, %lo(eg)(a0)
31+
; RV64I-NEXT: #NO_APP
32+
; RV64I-NEXT: ret
33+
;
34+
; RV32I-MEDIUM-LABEL: constraint_o_with_multi_operands:
35+
; RV32I-MEDIUM: # %bb.0:
36+
; RV32I-MEDIUM-NEXT: .Lpcrel_hi0:
37+
; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
38+
; RV32I-MEDIUM-NEXT: #APP
39+
; RV32I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi0)(a0) \n sw zero, %pcrel_lo(.Lpcrel_hi0)(a0)
40+
; RV32I-MEDIUM-NEXT: #NO_APP
41+
; RV32I-MEDIUM-NEXT: ret
42+
;
43+
; RV64I-MEDIUM-LABEL: constraint_o_with_multi_operands:
44+
; RV64I-MEDIUM: # %bb.0:
45+
; RV64I-MEDIUM-NEXT: .Lpcrel_hi0:
46+
; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
47+
; RV64I-MEDIUM-NEXT: #APP
48+
; RV64I-MEDIUM-NEXT: sw zero, %pcrel_lo(.Lpcrel_hi0)(a0) \n sw zero, %pcrel_lo(.Lpcrel_hi0)(a0)
49+
; RV64I-MEDIUM-NEXT: #NO_APP
50+
; RV64I-MEDIUM-NEXT: ret
51+
call void asm "sw zero, $0 \n sw zero, $1", "=*o,=*o"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
52+
ret void
53+
}
54+
55+
define void @constraint_A_with_multi_operands() nounwind {
56+
; RV32I-LABEL: constraint_A_with_multi_operands:
57+
; RV32I: # %bb.0:
58+
; RV32I-NEXT: lui a0, %hi(eg)
59+
; RV32I-NEXT: addi a0, a0, %lo(eg)
60+
; RV32I-NEXT: #APP
61+
; RV32I-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
62+
; RV32I-NEXT: #NO_APP
63+
; RV32I-NEXT: ret
64+
;
65+
; RV64I-LABEL: constraint_A_with_multi_operands:
66+
; RV64I: # %bb.0:
67+
; RV64I-NEXT: lui a0, %hi(eg)
68+
; RV64I-NEXT: addi a0, a0, %lo(eg)
69+
; RV64I-NEXT: #APP
70+
; RV64I-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
71+
; RV64I-NEXT: #NO_APP
72+
; RV64I-NEXT: ret
73+
;
74+
; RV32I-MEDIUM-LABEL: constraint_A_with_multi_operands:
75+
; RV32I-MEDIUM: # %bb.0:
76+
; RV32I-MEDIUM-NEXT: .Lpcrel_hi1:
77+
; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
78+
; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi1)
79+
; RV32I-MEDIUM-NEXT: #APP
80+
; RV32I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
81+
; RV32I-MEDIUM-NEXT: #NO_APP
82+
; RV32I-MEDIUM-NEXT: ret
83+
;
84+
; RV64I-MEDIUM-LABEL: constraint_A_with_multi_operands:
85+
; RV64I-MEDIUM: # %bb.0:
86+
; RV64I-MEDIUM-NEXT: .Lpcrel_hi1:
87+
; RV64I-MEDIUM-NEXT: auipc a0, %pcrel_hi(eg)
88+
; RV64I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Lpcrel_hi1)
89+
; RV64I-MEDIUM-NEXT: #APP
90+
; RV64I-MEDIUM-NEXT: sw zero, 0(a0) \n sw zero, 0(a0)
91+
; RV64I-MEDIUM-NEXT: #NO_APP
92+
; RV64I-MEDIUM-NEXT: ret
93+
call void asm "sw zero, $0 \n sw zero, $1", "=*A,=*A"(ptr elementtype(i32) @eg, ptr elementtype(i32) @eg)
94+
ret void
95+
}

0 commit comments

Comments
 (0)