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 = "powerpc64-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(%struct.small_arg* noalias nocapture sret %agg.result, %struct.large_arg* byval nocapture readnone %pad, %struct.small_arg* byval nocapture readonly %x) {
18 %0 = bitcast %struct.small_arg* %x to i32*
19 %1 = bitcast %struct.small_arg* %agg.result to i32*
20 %2 = load i32, i32* %0, align 2
21 store i32 %2, i32* %1, align 2
25 ; CHECK: lwz {{[0-9]+}}, 124(1)
28 define void @caller1() {
30 %tmp = alloca %struct.small_arg, align 2
31 call void @test1(%struct.small_arg* sret %tmp, %struct.large_arg* byval @gl, %struct.small_arg* byval @gs)
35 ; CHECK: stw {{[0-9]+}}, 124(1)
38 declare void @test1(%struct.small_arg* sret, %struct.large_arg* byval, %struct.small_arg* byval)
40 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) {
45 ; CHECK: lfs {{[0-9]+}}, 156(1)
48 define void @caller2() {
50 %0 = load float, float* @gf, align 4
51 %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)
55 ; CHECK: std {{[0-9]+}}, 16(1)
58 declare float @test2(float, float, float, float, float, float, float, float, float, float, float, float, float, float)