forked from OSchip/llvm-project
Initial checkin of testcases for Pi node inserter
llvm-svn: 2590
This commit is contained in:
parent
e291226f02
commit
6a4fa1c8b5
|
@ -0,0 +1,10 @@
|
|||
|
||||
LEVEL = ../../../..
|
||||
include $(LEVEL)/test/Makefile.tests
|
||||
|
||||
TESTS := $(wildcard *.ll)
|
||||
|
||||
all:: $(addprefix Output/, $(TESTS:%.ll=%.ll.out))
|
||||
|
||||
Output/%.ll.out: %.ll Output/.dir $(LOPT)
|
||||
-$(TESTRUNR) $<
|
|
@ -0,0 +1,16 @@
|
|||
; RUN: if as < %s | opt -pinodes -instcombine -die | dis | grep add
|
||||
; RUN: then exit 1
|
||||
; RUN: else exit 0
|
||||
; RUN: fi
|
||||
|
||||
int "test"(int %i, int %j) {
|
||||
%c = seteq int %i, 0
|
||||
br bool %c, label %iIsZero, label %iIsNotZero
|
||||
|
||||
iIsZero:
|
||||
%j2 = add int %j, %i ; This is always equal to j
|
||||
ret int %j2
|
||||
|
||||
iIsNotZero:
|
||||
ret int 1
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
int "test"(int %i) {
|
||||
%c = seteq int %i, 0
|
||||
br bool %c, label %iIsZero, label %iIsNotZero
|
||||
|
||||
iIsZero:
|
||||
ret int %i
|
||||
|
||||
iIsZero2:
|
||||
ret int 0
|
||||
iIsNotZero:
|
||||
%d = setne int %i, 0
|
||||
br bool %d, label %Quit, label %iIsZero2
|
||||
|
||||
Quit:
|
||||
ret int 1
|
||||
}
|
Loading…
Reference in New Issue