blob: 0c9f59fd302c9b6b7f60d20709415c3ccdad1de4 [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
Alex Bradbury660bcce2017-12-11 11:53:54 +00007define i32 @test() nounwind {
8; RV32I-LABEL: test:
9; RV32I: # %bb.0:
Alex Bradburyb014e3d2017-12-11 12:34:11 +000010; RV32I-NEXT: addi sp, sp, -32
Alex Bradbury660bcce2017-12-11 11:53:54 +000011; RV32I-NEXT: sw ra, 28(sp)
Alex Bradburyb014e3d2017-12-11 12:34:11 +000012; RV32I-NEXT: sw s0, 24(sp)
13; RV32I-NEXT: addi s0, sp, 32
Alex Bradbury660bcce2017-12-11 11:53:54 +000014; RV32I-NEXT: sw zero, -16(s0)
15; RV32I-NEXT: sw zero, -20(s0)
16; RV32I-NEXT: sw zero, -24(s0)
Alex Bradburyb014e3d2017-12-11 12:34:11 +000017; RV32I-NEXT: sw zero, -28(s0)
18; RV32I-NEXT: sw zero, -32(s0)
Alex Bradbury660bcce2017-12-11 11:53:54 +000019; RV32I-NEXT: lui a0, %hi(test1)
20; RV32I-NEXT: addi a1, a0, %lo(test1)
Alex Bradburyb014e3d2017-12-11 12:34:11 +000021; RV32I-NEXT: addi a0, s0, -28
Alex Bradbury59136ff2017-12-15 09:47:01 +000022; RV32I-NEXT: jalr a1
23; RV32I-NEXT: mv a0, zero
Alex Bradburyb014e3d2017-12-11 12:34:11 +000024; RV32I-NEXT: lw s0, 24(sp)
Alex Bradbury660bcce2017-12-11 11:53:54 +000025; RV32I-NEXT: lw ra, 28(sp)
Alex Bradburyb014e3d2017-12-11 12:34:11 +000026; RV32I-NEXT: addi sp, sp, 32
Alex Bradbury59136ff2017-12-15 09:47:01 +000027; RV32I-NEXT: ret
Alex Bradbury660bcce2017-12-11 11:53:54 +000028 %key = alloca %struct.key_t, align 4
29 %1 = bitcast %struct.key_t* %key to i8*
30 call void @llvm.memset.p0i8.i64(i8* %1, i8 0, i64 20, i32 4, i1 false)
31 %2 = getelementptr inbounds %struct.key_t, %struct.key_t* %key, i64 0, i32 1, i64 0
32 call void @test1(i8* %2) #3
33 ret i32 0
34}
35
36declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1)
37
38declare void @test1(i8*)