llvm-mirror/test/Transforms/ConstProp/2007-11-23-cttz.ll
Benjamin Kramer f95255b370 ConstantFolding: Add a missing folding that leads to a miscompile.
We use constant folding to see if an intrinsic evaluates to the same value as a
constant that we know. If we don't take the undefinedness into account we get a
value that doesn't match the actual implementation, and miscompiled code.

This was uncovered by Chandler's simplifycfg changes.

llvm-svn: 173356
2013-01-24 16:28:28 +00:00

9 lines
178 B
LLVM

; RUN: opt < %s -constprop -S | grep "ret i13 13"
; PR1816
declare i13 @llvm.cttz.i13(i13, i1)
define i13 @test() {
%X = call i13 @llvm.cttz.i13(i13 0, i1 false)
ret i13 %X
}