blob: ca1d6180c75876522c45c2138ed3ce5e69e9433b [file] [log] [blame]
Chris Lattner0ab5e2c2011-04-15 05:18:47 +00001; This bug has to do with the fact that constant propagation was implemented in
Chris Lattner40acfe32002-05-03 19:58:17 +00002; terms of _logical_ not (! in C) instead of _bitwise_ not (~ in C). This was
3; due to a spec change.
4
Chris Lattner07a52182002-08-14 19:28:09 +00005; Fix #2: The unary not instruction now no longer exists. Change to xor.
6
Dan Gohman18800922009-09-11 18:01:28 +00007; RUN: opt < %s -constprop -S | \
Chandler Carruthff123d52012-07-02 19:09:46 +00008; RUN: not grep "i32 0"
Chris Lattner40acfe32002-05-03 19:58:17 +00009
Tanya Lattner5640bd12008-03-01 09:15:35 +000010define i32 @test1() {
11 %R = xor i32 123, -1 ; <i32> [#uses=1]
12 ret i32 %R
Chris Lattner40acfe32002-05-03 19:58:17 +000013}
14
Tanya Lattner5640bd12008-03-01 09:15:35 +000015define i32 @test2() {
16 %R = xor i32 -123, -1 ; <i32> [#uses=1]
17 ret i32 %R
Chris Lattner40acfe32002-05-03 19:58:17 +000018}
Tanya Lattner5640bd12008-03-01 09:15:35 +000019