2006-11-27 01:05:10 +00:00
|
|
|
; Check to make sure that Value Numbering doesn't merge casts of different
|
|
|
|
; flavors.
|
2008-02-14 06:56:27 +00:00
|
|
|
; RUN: llvm-as < %s | opt -load-vn -gcse | llvm-dis | \
|
2007-08-15 13:36:28 +00:00
|
|
|
; RUN: grep {\[sz\]ext} | count 2
|
2006-11-27 01:05:10 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
declare void @external(i32)
|
2006-11-27 01:05:10 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
define i32 @test_casts(i16 %x) {
|
|
|
|
%a = sext i16 %x to i32 ; <i32> [#uses=1]
|
|
|
|
%b = zext i16 %x to i32 ; <i32> [#uses=1]
|
|
|
|
call void @external( i32 %a )
|
|
|
|
ret i32 %b
|
2006-11-27 01:05:10 +00:00
|
|
|
}
|