Alex Bradbury | 660bcce | 2017-12-11 11:53:54 +0000 | [diff] [blame] | 1 | ; 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 Bradbury | 660bcce | 2017-12-11 11:53:54 +0000 | [diff] [blame] | 7 | define i32 @test() nounwind { |
| 8 | ; RV32I-LABEL: test: |
| 9 | ; RV32I: # %bb.0: |
Alex Bradbury | b014e3d | 2017-12-11 12:34:11 +0000 | [diff] [blame] | 10 | ; RV32I-NEXT: addi sp, sp, -32 |
Alex Bradbury | 660bcce | 2017-12-11 11:53:54 +0000 | [diff] [blame] | 11 | ; RV32I-NEXT: sw ra, 28(sp) |
Alex Bradbury | b014e3d | 2017-12-11 12:34:11 +0000 | [diff] [blame] | 12 | ; RV32I-NEXT: sw s0, 24(sp) |
| 13 | ; RV32I-NEXT: addi s0, sp, 32 |
Alex Bradbury | 660bcce | 2017-12-11 11:53:54 +0000 | [diff] [blame] | 14 | ; RV32I-NEXT: sw zero, -16(s0) |
| 15 | ; RV32I-NEXT: sw zero, -20(s0) |
| 16 | ; RV32I-NEXT: sw zero, -24(s0) |
Alex Bradbury | b014e3d | 2017-12-11 12:34:11 +0000 | [diff] [blame] | 17 | ; RV32I-NEXT: sw zero, -28(s0) |
| 18 | ; RV32I-NEXT: sw zero, -32(s0) |
Alex Bradbury | 660bcce | 2017-12-11 11:53:54 +0000 | [diff] [blame] | 19 | ; RV32I-NEXT: lui a0, %hi(test1) |
| 20 | ; RV32I-NEXT: addi a1, a0, %lo(test1) |
Alex Bradbury | b014e3d | 2017-12-11 12:34:11 +0000 | [diff] [blame] | 21 | ; RV32I-NEXT: addi a0, s0, -28 |
Alex Bradbury | 59136ff | 2017-12-15 09:47:01 +0000 | [diff] [blame] | 22 | ; RV32I-NEXT: jalr a1 |
| 23 | ; RV32I-NEXT: mv a0, zero |
Alex Bradbury | b014e3d | 2017-12-11 12:34:11 +0000 | [diff] [blame] | 24 | ; RV32I-NEXT: lw s0, 24(sp) |
Alex Bradbury | 660bcce | 2017-12-11 11:53:54 +0000 | [diff] [blame] | 25 | ; RV32I-NEXT: lw ra, 28(sp) |
Alex Bradbury | b014e3d | 2017-12-11 12:34:11 +0000 | [diff] [blame] | 26 | ; RV32I-NEXT: addi sp, sp, 32 |
Alex Bradbury | 59136ff | 2017-12-15 09:47:01 +0000 | [diff] [blame] | 27 | ; RV32I-NEXT: ret |
Alex Bradbury | 660bcce | 2017-12-11 11:53:54 +0000 | [diff] [blame] | 28 | %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 | |
| 36 | declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) |
| 37 | |
| 38 | declare void @test1(i8*) |