1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 < %s | FileCheck %s --check-prefix=RV32
3 ; RUN: llc -mtriple=riscv64 < %s | FileCheck %s --check-prefix=RV64
5 @var = external dso_local global i32, align 4
7 define dso_local i8* @constraint_S() {
8 ; RV32-LABEL: constraint_S:
11 ; RV32-NEXT: lui a0, %hi(var)
12 ; RV32-NEXT: addi a0, a0, %lo(var)
16 ; RV64-LABEL: constraint_S:
19 ; RV64-NEXT: lui a0, %hi(var)
20 ; RV64-NEXT: addi a0, a0, %lo(var)
23 %ret = tail call i8* asm "lui $0, %hi($1)\0Aaddi $0, $0, %lo($1)", "=r,S"(i32* nonnull @var)
27 ; Function Attrs: nofree nosync nounwind readnone
28 define dso_local i8* @constraint_S_label() {
29 ; RV32-LABEL: constraint_S_label:
30 ; RV32: # %bb.0: # %entry
31 ; RV32-NEXT: .Ltmp0: # Block address taken
32 ; RV32-NEXT: # %bb.1: # %L1
34 ; RV32-NEXT: lui a0, %hi(.Ltmp0)
35 ; RV32-NEXT: addi a0, a0, %lo(.Ltmp0)
39 ; RV64-LABEL: constraint_S_label:
40 ; RV64: # %bb.0: # %entry
41 ; RV64-NEXT: .Ltmp0: # Block address taken
42 ; RV64-NEXT: # %bb.1: # %L1
44 ; RV64-NEXT: lui a0, %hi(.Ltmp0)
45 ; RV64-NEXT: addi a0, a0, %lo(.Ltmp0)
52 %ret = tail call i8* asm "lui $0, %hi($1)\0Aaddi $0, $0, %lo($1)", "=r,S"(i8* blockaddress(@constraint_S_label, %L1))