blob: 22c078250ece702d0a389805fc470d1e2162c2d5 [file] [log] [blame]
Jim Grosbach0ab54182012-02-03 00:00:50 +00001; Ignore stderr, we expect warnings there
Matt Arsenaultfbfdced2013-06-28 01:29:35 +00002; RUN: opt < %s -instcombine 2> /dev/null -S | FileCheck %s
3
4; CHECK-NOT: bitcast
Jim Grosbach0ab54182012-02-03 00:00:50 +00005
6define void @a() {
Matt Arsenaultcacbb232013-07-30 20:45:05 +00007 ret void
Jim Grosbach0ab54182012-02-03 00:00:50 +00008}
9
10define signext i32 @b(i32* inreg %x) {
Matt Arsenaultcacbb232013-07-30 20:45:05 +000011 ret i32 0
Jim Grosbach0ab54182012-02-03 00:00:50 +000012}
13
14define void @c(...) {
Matt Arsenaultcacbb232013-07-30 20:45:05 +000015 ret void
Jim Grosbach0ab54182012-02-03 00:00:50 +000016}
17
18define void @g(i32* %y) {
Matt Arsenaultcacbb232013-07-30 20:45:05 +000019; CHECK-LABEL: @g(
20; CHECK: call i64 bitcast (i32 (i32*)* @b to i64 (i32)*)(i32 0)
Jim Grosbach0ab54182012-02-03 00:00:50 +000021 %x = call i64 bitcast (i32 (i32*)* @b to i64 (i32)*)( i32 0 ) ; <i64> [#uses=0]
Matt Arsenaultcacbb232013-07-30 20:45:05 +000022
23; The rest should not have bitcasts remaining
24; CHECK-NOT: bitcast
25 call void bitcast (void ()* @a to void (i32*)*)( i32* noalias %y )
26 call <2 x i32> bitcast (i32 (i32*)* @b to <2 x i32> (i32*)*)( i32* inreg null ) ; <<2 x i32>>:1 [#uses=0]
27 call void bitcast (void (...)* @c to void (i32)*)( i32 0 )
28 call void bitcast (void (...)* @c to void (i32)*)( i32 zeroext 0 )
29 ret void
Jim Grosbach0ab54182012-02-03 00:00:50 +000030}