95 lines · plain
1; RUN: llc < %s | FileCheck %s2 3target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"4target triple = "armv7-none--gnueabihf"5 6%struct.s = type { float, float }7%union.t = type { [4 x float] }8 9; Equivalent C code:10; struct s { float a; float b; };11; float foo(float a, double b, struct s c) { return c.a; }12; Argument allocation:13; a -> s014; b -> d115; c -> s4, s516; s1 is unused17; return in s018define float @test1(float %a, double %b, %struct.s %c) {19entry:20; CHECK-LABEL: test121; CHECK: vmov.f32 s0, s422; CHECK-NOT: vmov.f32 s0, s123 24 %result = extractvalue %struct.s %c, 025 ret float %result26}27 28; Equivalent C code:29; union t { float a[4] };30; float foo(float a, double b, union s c) { return c.a[0]; }31; Argument allocation:32; a -> s033; b -> d134; c -> s4..s735define float @test2(float %a, double %b, %union.t %c) #0 {36entry:37; CHECK-LABEL: test238; CHECK: vmov.f32 s0, s439; CHECK-NOT: vmov.f32 s0, s140 41 %result = extractvalue %union.t %c, 0, 042 ret float %result43}44 45; Equivalent C code:46; struct s { float a; float b; };47; float foo(float a, double b, struct s c, float d) { return d; }48; Argument allocation:49; a -> s050; b -> d151; c -> s4, s552; d -> s153; return in s054define float @test3(float %a, double %b, %struct.s %c, float %d) {55entry:56; CHECK-LABEL: test357; CHECK: vmov.f32 s0, s158; CHECK-NOT: vmov.f32 s0, s559 60 ret float %d61}62 63; Equivalent C code:64; struct s { float a; float b; };65; float foo(struct s a, struct s b) { return b.b; }66; Argument allocation:67; a -> s0, s168; b -> s2, s369; return in s070define float @test4(%struct.s %a, %struct.s %b) {71entry:72; CHECK-LABEL: test473; CHECK: vmov.f32 s0, s374 75 %result = extractvalue %struct.s %b, 176 ret float %result77}78 79; Equivalent C code:80; struct s { float a; float b; };81; float foo(struct s a, float b, struct s c) { return c.a; }82; Argument allocation:83; a -> s0, s184; b -> s285; c -> s3, s486; return in s087define float @test5(%struct.s %a, float %b, %struct.s %c) {88entry:89; CHECK-LABEL: test590; CHECK: vmov.f32 s0, s391 92 %result = extractvalue %struct.s %c, 093 ret float %result94}95