1; RUN: llc -verify-machineinstrs -mattr=-vsx \ 2; RUN: -mattr=+allow-unaligned-fp-access < %s | FileCheck %s 3; ModuleID = 'foo.c' 4 5target triple = "powerpc-unknown-linux-gnu" 6 7 %struct.anon = type <{ i8, float }> 8@s = global %struct.anon <{ i8 3, float 0x4014666660000000 }> ; <%struct.anon*> [#uses=1] 9@u = global <{ i8, double }> <{ i8 3, double 5.100000e+00 }> ; <<{ i8, double }>*> [#uses=1] 10@t = weak global %struct.anon zeroinitializer ; <%struct.anon*> [#uses=2] 11@v = weak global <{ i8, double }> zeroinitializer ; <<{ i8, double }>*> [#uses=2] 12@.str = internal constant [8 x i8] c"%f %lf\0A\00" ; <[8 x i8]*> [#uses=1] 13 14; CHECK: foo 15; CHECK: lfs 16; CHECK: lfd 17; CHECK: stfs 18; CHECK: stfd 19; CHECK: blr 20define i32 @foo() { 21entry: 22 %retval = alloca i32, align 4 ; <i32*> [#uses=1] 23 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] 24 %tmp = getelementptr %struct.anon, %struct.anon* @s, i32 0, i32 1 ; <float*> [#uses=1] 25 %tmp1 = load float, float* %tmp, align 1 ; <float> [#uses=1] 26 %tmp2 = getelementptr %struct.anon, %struct.anon* @t, i32 0, i32 1 ; <float*> [#uses=1] 27 store float %tmp1, float* %tmp2, align 1 28 %tmp3 = getelementptr <{ i8, double }>, <{ i8, double }>* @u, i32 0, i32 1 ; <double*> [#uses=1] 29 %tmp4 = load double, double* %tmp3, align 1 ; <double> [#uses=1] 30 %tmp5 = getelementptr <{ i8, double }>, <{ i8, double }>* @v, i32 0, i32 1 ; <double*> [#uses=1] 31 store double %tmp4, double* %tmp5, align 1 32 br label %return 33 34return: ; preds = %entry 35 %retval6 = load i32, i32* %retval ; <i32> [#uses=1] 36 ret i32 %retval6 37} 38 39; CHECK: main 40; CHECK: lfs 41; CHECK: lfd 42; CHECK: blr 43define i32 @main() { 44entry: 45 %retval = alloca i32, align 4 ; <i32*> [#uses=1] 46 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] 47 %tmp = call i32 @foo( ) ; <i32> [#uses=0] 48 %tmp1 = getelementptr %struct.anon, %struct.anon* @t, i32 0, i32 1 ; <float*> [#uses=1] 49 %tmp2 = load float, float* %tmp1, align 1 ; <float> [#uses=1] 50 %tmp23 = fpext float %tmp2 to double ; <double> [#uses=1] 51 %tmp4 = getelementptr <{ i8, double }>, <{ i8, double }>* @v, i32 0, i32 1 ; <double*> [#uses=1] 52 %tmp5 = load double, double* %tmp4, align 1 ; <double> [#uses=1] 53 %tmp6 = getelementptr [8 x i8], [8 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1] 54 %tmp7 = call i32 (i8*, ...) @printf( i8* %tmp6, double %tmp23, double %tmp5 ) ; <i32> [#uses=0] 55 br label %return 56 57return: ; preds = %entry 58 %retval8 = load i32, i32* %retval ; <i32> [#uses=1] 59 ret i32 %retval8 60} 61 62declare i32 @printf(i8*, ...) 63