1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test/Transforms/InstCombine/apint-not.ll
Dan Gohman 8d84372836 Change these tests to feed the assembly files to opt directly, instead
of using llvm-as, now that opt supports this.

llvm-svn: 81226
2009-09-08 16:50:01 +00:00

43 lines
920 B
LLVM

; This test makes sure that the xor instructions are properly eliminated
; when arbitrary precision integers are used.
; RUN: opt %s -instcombine | llvm-dis | not grep xor
define i33 @test1(i33 %A) {
%B = xor i33 %A, -1
%C = xor i33 %B, -1
ret i33 %C
}
define i1 @test2(i52 %A, i52 %B) {
%cond = icmp ule i52 %A, %B ; Can change into uge
%Ret = xor i1 %cond, true
ret i1 %Ret
}
; Test that demorgans law can be instcombined
define i47 @test3(i47 %A, i47 %B) {
%a = xor i47 %A, -1
%b = xor i47 %B, -1
%c = and i47 %a, %b
%d = xor i47 %c, -1
ret i47 %d
}
; Test that demorgens law can work with constants
define i61 @test4(i61 %A, i61 %B) {
%a = xor i61 %A, -1
%c = and i61 %a, 5 ; 5 = ~c2
%d = xor i61 %c, -1
ret i61 %d
}
; test the mirror of demorgans law...
define i71 @test5(i71 %A, i71 %B) {
%a = xor i71 %A, -1
%b = xor i71 %B, -1
%c = or i71 %a, %b
%d = xor i71 %c, -1
ret i71 %d
}