projects
/
oota-llvm.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
More tests
[oota-llvm.git]
/
test
/
Transforms
/
InstCombine
/
sub.ll
1
; This test makes sure that these instructions are properly eliminated.
2
;
3
4
; RUN: if as < %s | opt -instcombine -dce | dis | grep sub
5
; RUN: then exit 1
6
; RUN: else exit 0
7
; RUN: fi
8
9
implementation
10
11
int "test1"(int %A) {
12
%B = sub int %A, %A ; ISA constant 0
13
ret int %B
14
}
15
16
int "test2"(int %A) {
17
%B = sub int %A, 0
18
ret int %B
19
}
20
21
int "test3"(int %A) {
22
%B = sub int 0, %A ; B = -A
23
%C = sub int 0, %B ; C = -B = A
24
ret int %C
25
}