blob: a7e2f39b4e2b8b24297111d067e09c07b97ddbbc [file] [log] [blame]
Dale Johannesenc4d3c1c2008-04-23 01:22:22 +00001;; The bitcast cannot be eliminated because byval arguments need
2;; the correct type, or at least a type of the correct size.
3; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep bitcast
4target 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-f80:128:128"
5target triple = "i386-apple-darwin9"
6 %struct.NSRect = type { [4 x float] }
7
8define void @foo(i8* %context) nounwind {
9entry:
10 %context_addr = alloca i8* ; <i8**> [#uses=2]
11 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
12 store i8* %context, i8** %context_addr
13 %tmp = load i8** %context_addr, align 4 ; <i8*> [#uses=1]
14 %tmp1 = bitcast i8* %tmp to %struct.NSRect* ; <%struct.NSRect*> [#uses=1]
15 call void (i32, ...)* @bar( i32 3, %struct.NSRect* byval align 4 %tmp1 ) nounwind
16 br label %return
17return: ; preds = %entry
18 ret void
19}
20
21declare void @bar(i32, ...)