blob: 4a2486e0026a8834f3861ed1e068fd5eba73be35 [file] [log] [blame]
Alex Bradbury660bcce2017-12-11 11:53:54 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3; RUN: | FileCheck -check-prefix=RV32I %s
4
5%struct.key_t = type { i32, [16 x i8] }
6
7; FIXME: prologue and epilogue insertion must be implemented to complete this
8; test
9
10define i32 @test() nounwind {
11; RV32I-LABEL: test:
12; RV32I: # %bb.0:
13; RV32I-NEXT: sw ra, 28(sp)
14; RV32I-NEXT: sw zero, -8(s0)
15; RV32I-NEXT: sw zero, -12(s0)
16; RV32I-NEXT: sw zero, -16(s0)
17; RV32I-NEXT: sw zero, -20(s0)
18; RV32I-NEXT: sw zero, -24(s0)
19; RV32I-NEXT: lui a0, %hi(test1)
20; RV32I-NEXT: addi a1, a0, %lo(test1)
21; RV32I-NEXT: addi a0, s0, -20
22; RV32I-NEXT: jalr ra, a1, 0
23; RV32I-NEXT: addi a0, zero, 0
24; RV32I-NEXT: lw ra, 28(sp)
25; RV32I-NEXT: jalr zero, ra, 0
26 %key = alloca %struct.key_t, align 4
27 %1 = bitcast %struct.key_t* %key to i8*
28 call void @llvm.memset.p0i8.i64(i8* %1, i8 0, i64 20, i32 4, i1 false)
29 %2 = getelementptr inbounds %struct.key_t, %struct.key_t* %key, i64 0, i32 1, i64 0
30 call void @test1(i8* %2) #3
31 ret i32 0
32}
33
34declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
35
36declare void @test1(i8*)