llvm-6502/test/Transforms/InstCombine/apint-add1.ll
Dan Gohman b1e1e82c54 Change these tests to feed the assembly files to opt directly, instead
of using llvm-as, now that opt supports this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 16:50:01 +00:00

35 lines
916 B
LLVM

; This test makes sure that add instructions are properly eliminated.
; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
; RUN: opt %s -instcombine | llvm-dis | \
; RUN: grep -v OK | not grep add
define i1 @test1(i1 %x) {
%tmp.2 = xor i1 %x, 1
;; Add of sign bit -> xor of sign bit.
%tmp.4 = add i1 %tmp.2, 1
ret i1 %tmp.4
}
define i47 @test2(i47 %x) {
%tmp.2 = xor i47 %x, 70368744177664
;; Add of sign bit -> xor of sign bit.
%tmp.4 = add i47 %tmp.2, 70368744177664
ret i47 %tmp.4
}
define i15 @test3(i15 %x) {
%tmp.2 = xor i15 %x, 16384
;; Add of sign bit -> xor of sign bit.
%tmp.4 = add i15 %tmp.2, 16384
ret i15 %tmp.4
}
define i49 @test6(i49 %x) {
;; (x & 254)+1 -> (x & 254)|1
%tmp.2 = and i49 %x, 562949953421310
%tmp.4 = add i49 %tmp.2, 1
ret i49 %tmp.4
}