blob: ccbadb4255a02ee5ae314e2708b6e182e2c6e732 [file] [log] [blame]
Bill Schmidt32e9c642014-10-17 01:41:22 +00001; RUN: llc -mattr=-vsx < %s | grep stfd | count 3
2; RUN: llc -mattr=-vsx < %s | grep stfs | count 1
3; RUN: llc -mattr=-vsx < %s | grep lfd | count 2
4; RUN: llc -mattr=-vsx < %s | grep lfs | count 2
Dale Johannesen29e6ac42007-09-08 19:29:23 +00005; ModuleID = 'foo.c'
6target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
7target triple = "powerpc-apple-darwin8"
8 %struct.anon = type <{ i8, float }>
9@s = global %struct.anon <{ i8 3, float 0x4014666660000000 }> ; <%struct.anon*> [#uses=1]
10@u = global <{ i8, double }> <{ i8 3, double 5.100000e+00 }> ; <<{ i8, double }>*> [#uses=1]
11@t = weak global %struct.anon zeroinitializer ; <%struct.anon*> [#uses=2]
12@v = weak global <{ i8, double }> zeroinitializer ; <<{ i8, double }>*> [#uses=2]
13@.str = internal constant [8 x i8] c"%f %lf\0A\00" ; <[8 x i8]*> [#uses=1]
14
15define i32 @foo() {
16entry:
17 %retval = alloca i32, align 4 ; <i32*> [#uses=1]
18 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
David Blaikie79e6c742015-02-27 19:29:02 +000019 %tmp = getelementptr %struct.anon, %struct.anon* @s, i32 0, i32 1 ; <float*> [#uses=1]
David Blaikiea79ac142015-02-27 21:17:42 +000020 %tmp1 = load float, float* %tmp, align 1 ; <float> [#uses=1]
David Blaikie79e6c742015-02-27 19:29:02 +000021 %tmp2 = getelementptr %struct.anon, %struct.anon* @t, i32 0, i32 1 ; <float*> [#uses=1]
Dale Johannesen29e6ac42007-09-08 19:29:23 +000022 store float %tmp1, float* %tmp2, align 1
David Blaikie79e6c742015-02-27 19:29:02 +000023 %tmp3 = getelementptr <{ i8, double }>, <{ i8, double }>* @u, i32 0, i32 1 ; <double*> [#uses=1]
David Blaikiea79ac142015-02-27 21:17:42 +000024 %tmp4 = load double, double* %tmp3, align 1 ; <double> [#uses=1]
David Blaikie79e6c742015-02-27 19:29:02 +000025 %tmp5 = getelementptr <{ i8, double }>, <{ i8, double }>* @v, i32 0, i32 1 ; <double*> [#uses=1]
Dale Johannesen29e6ac42007-09-08 19:29:23 +000026 store double %tmp4, double* %tmp5, align 1
27 br label %return
28
29return: ; preds = %entry
David Blaikiea79ac142015-02-27 21:17:42 +000030 %retval6 = load i32, i32* %retval ; <i32> [#uses=1]
Dale Johannesen29e6ac42007-09-08 19:29:23 +000031 ret i32 %retval6
32}
33
34define i32 @main() {
35entry:
36 %retval = alloca i32, align 4 ; <i32*> [#uses=1]
37 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
38 %tmp = call i32 @foo( ) ; <i32> [#uses=0]
David Blaikie79e6c742015-02-27 19:29:02 +000039 %tmp1 = getelementptr %struct.anon, %struct.anon* @t, i32 0, i32 1 ; <float*> [#uses=1]
David Blaikiea79ac142015-02-27 21:17:42 +000040 %tmp2 = load float, float* %tmp1, align 1 ; <float> [#uses=1]
Dale Johannesen29e6ac42007-09-08 19:29:23 +000041 %tmp23 = fpext float %tmp2 to double ; <double> [#uses=1]
David Blaikie79e6c742015-02-27 19:29:02 +000042 %tmp4 = getelementptr <{ i8, double }>, <{ i8, double }>* @v, i32 0, i32 1 ; <double*> [#uses=1]
David Blaikiea79ac142015-02-27 21:17:42 +000043 %tmp5 = load double, double* %tmp4, align 1 ; <double> [#uses=1]
David Blaikie79e6c742015-02-27 19:29:02 +000044 %tmp6 = getelementptr [8 x i8], [8 x i8]* @.str, i32 0, i32 0 ; <i8*> [#uses=1]
David Blaikie23af6482015-04-16 23:24:18 +000045 %tmp7 = call i32 (i8*, ...) @printf( i8* %tmp6, double %tmp23, double %tmp5 ) ; <i32> [#uses=0]
Dale Johannesen29e6ac42007-09-08 19:29:23 +000046 br label %return
47
48return: ; preds = %entry
David Blaikiea79ac142015-02-27 21:17:42 +000049 %retval8 = load i32, i32* %retval ; <i32> [#uses=1]
Dale Johannesen29e6ac42007-09-08 19:29:23 +000050 ret i32 %retval8
51}
52
53declare i32 @printf(i8*, ...)