1 ; RUN: opt < %s -scalarrepl -S | not grep alloca
3 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
5 ;; Store of integer to whole alloca struct.
6 define i32 @test1(i64 %V) nounwind {
7 %X = alloca {{i32, i32}}
8 %Y = bitcast {{i32,i32}}* %X to i64*
11 %A = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 0
12 %B = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 1
19 ;; Store of integer to whole struct/array alloca.
20 define float @test2(i128 %V) nounwind {
21 %X = alloca {[4 x float]}
22 %Y = bitcast {[4 x float]}* %X to i128*
23 store i128 %V, i128* %Y
25 %A = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 0
26 %B = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 3
29 %c = fadd float %a, %b
33 ;; Load of whole alloca struct as integer
34 define i64 @test3(i32 %a, i32 %b) nounwind {
35 %X = alloca {{i32, i32}}
37 %A = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 0
38 %B = getelementptr {{i32,i32}}* %X, i32 0, i32 0, i32 1
42 %Y = bitcast {{i32,i32}}* %X to i64*
47 ;; load of integer from whole struct/array alloca.
48 define i128 @test4(float %a, float %b) nounwind {
49 %X = alloca {[4 x float]}
50 %A = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 0
51 %B = getelementptr {[4 x float]}* %X, i32 0, i32 0, i32 3
52 store float %a, float* %A
53 store float %b, float* %B
55 %Y = bitcast {[4 x float]}* %X to i128*