| Dale Johannesen | c4d3c1c | 2008-04-23 01:22:22 +0000 | [diff] [blame] | 1 | ;; The bitcast cannot be eliminated because byval arguments need |
| 2 | ;; the correct type, or at least a type of the correct size. |
| Dan Gohman | 1880092 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 3 | ; RUN: opt < %s -instcombine -S | grep bitcast |
| Dale Johannesen | c4d3c1c | 2008-04-23 01:22:22 +0000 | [diff] [blame] | 4 | 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-f80:128:128" |
| 5 | target triple = "i386-apple-darwin9" |
| 6 | %struct.NSRect = type { [4 x float] } |
| 7 | |
| 8 | define void @foo(i8* %context) nounwind { |
| 9 | entry: |
| Chris Lattner | 2161d6c | 2008-04-23 03:03:42 +0000 | [diff] [blame] | 10 | %tmp1 = bitcast i8* %context to %struct.NSRect* ; <%struct.NSRect*> [#uses=1] |
| David Blaikie | 23af648 | 2015-04-16 23:24:18 +0000 | [diff] [blame] | 11 | call void (i32, ...) @bar( i32 3, %struct.NSRect* byval align 4 %tmp1 ) nounwind |
| Dale Johannesen | c4d3c1c | 2008-04-23 01:22:22 +0000 | [diff] [blame] | 12 | ret void |
| 13 | } |
| 14 | |
| 15 | declare void @bar(i32, ...) |