[PPC] Adjust some PowerPC tests to account for presence/absence of VSX
[oota-llvm.git] / test / CodeGen / PowerPC / 2007-09-08-unaligned.ll
1 ; 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
5 ; RUN: llc -mattr=+vsx < %s | grep stxsdx | count 3
6 ; RUN: llc -mattr=+vsx < %s | grep stfs | count 1
7 ; RUN: llc -mattr=+vsx < %s | grep lxsdx | count 2
8 ; RUN: llc -mattr=+vsx < %s | grep lfs | count 2
9 ; ModuleID = 'foo.c'
10 target 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"
11 target triple = "powerpc-apple-darwin8"
12         %struct.anon = type <{ i8, float }>
13 @s = global %struct.anon <{ i8 3, float 0x4014666660000000 }>           ; <%struct.anon*> [#uses=1]
14 @u = global <{ i8, double }> <{ i8 3, double 5.100000e+00 }>            ; <<{ i8, double }>*> [#uses=1]
15 @t = weak global %struct.anon zeroinitializer           ; <%struct.anon*> [#uses=2]
16 @v = weak global <{ i8, double }> zeroinitializer               ; <<{ i8, double }>*> [#uses=2]
17 @.str = internal constant [8 x i8] c"%f %lf\0A\00"              ; <[8 x i8]*> [#uses=1]
18
19 define i32 @foo() {
20 entry:
21         %retval = alloca i32, align 4           ; <i32*> [#uses=1]
22         %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
23         %tmp = getelementptr %struct.anon* @s, i32 0, i32 1             ; <float*> [#uses=1]
24         %tmp1 = load float* %tmp, align 1               ; <float> [#uses=1]
25         %tmp2 = getelementptr %struct.anon* @t, i32 0, i32 1            ; <float*> [#uses=1]
26         store float %tmp1, float* %tmp2, align 1
27         %tmp3 = getelementptr <{ i8, double }>* @u, i32 0, i32 1                ; <double*> [#uses=1]
28         %tmp4 = load double* %tmp3, align 1             ; <double> [#uses=1]
29         %tmp5 = getelementptr <{ i8, double }>* @v, i32 0, i32 1                ; <double*> [#uses=1]
30         store double %tmp4, double* %tmp5, align 1
31         br label %return
32
33 return:         ; preds = %entry
34         %retval6 = load i32* %retval            ; <i32> [#uses=1]
35         ret i32 %retval6
36 }
37
38 define i32 @main() {
39 entry:
40         %retval = alloca i32, align 4           ; <i32*> [#uses=1]
41         %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
42         %tmp = call i32 @foo( )         ; <i32> [#uses=0]
43         %tmp1 = getelementptr %struct.anon* @t, i32 0, i32 1            ; <float*> [#uses=1]
44         %tmp2 = load float* %tmp1, align 1              ; <float> [#uses=1]
45         %tmp23 = fpext float %tmp2 to double            ; <double> [#uses=1]
46         %tmp4 = getelementptr <{ i8, double }>* @v, i32 0, i32 1                ; <double*> [#uses=1]
47         %tmp5 = load double* %tmp4, align 1             ; <double> [#uses=1]
48         %tmp6 = getelementptr [8 x i8]* @.str, i32 0, i32 0             ; <i8*> [#uses=1]
49         %tmp7 = call i32 (i8*, ...)* @printf( i8* %tmp6, double %tmp23, double %tmp5 )          ; <i32> [#uses=0]
50         br label %return
51
52 return:         ; preds = %entry
53         %retval8 = load i32* %retval            ; <i32> [#uses=1]
54         ret i32 %retval8
55 }
56
57 declare i32 @printf(i8*, ...)