1 ; Verify that small structures and float arguments are passed in the
2 ; least significant part of a stack slot doubleword.
4 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
6 target datalayout = "e-m:e-i64:64-n32:64"
7 target triple = "powerpc64le-unknown-linux-gnu"
9 %struct.large_arg = type { [8 x i64] }
10 %struct.small_arg = type { i16, i8 }
12 @gl = common global %struct.large_arg zeroinitializer, align 8
13 @gs = common global %struct.small_arg zeroinitializer, align 2
14 @gf = common global float 0.000000e+00, align 4
16 define void @callee1(ptr noalias nocapture sret(%struct.small_arg) %agg.result, ptr byval(%struct.large_arg) nocapture readnone %pad, ptr byval(%struct.small_arg) nocapture readonly %x) {
18 %0 = load i32, ptr %x, align 2
19 store i32 %0, ptr %agg.result, align 2
23 ; CHECK: lwz {{[0-9]+}}, 104(1)
26 define void @caller1() {
28 %tmp = alloca %struct.small_arg, align 2
29 call void @test1(ptr sret(%struct.small_arg) %tmp, ptr byval(%struct.large_arg) @gl, ptr byval(%struct.small_arg) @gs)
33 ; CHECK: stw {{[0-9]+}}, 104(1)
36 declare void @test1(ptr sret(%struct.small_arg), ptr byval(%struct.large_arg), ptr byval(%struct.small_arg))
38 define float @callee2(float %pad1, float %pad2, float %pad3, float %pad4, float %pad5, float %pad6, float %pad7, float %pad8, float %pad9, float %pad10, float %pad11, float %pad12, float %pad13, float %x) {
43 ; CHECK: lfs {{[0-9]+}}, 136(1)
46 define void @caller2() {
48 %0 = load float, ptr @gf, align 4
49 %call = tail call float @test2(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float %0)
53 ; CHECK: stw {{[0-9]+}}, 136({{[0-9]+}})
56 declare float @test2(float, float, float, float, float, float, float, float, float, float, float, float, float, float)