Initial checkin of testcases for Pi node inserter

llvm-svn: 2590
This commit is contained in:
Chris Lattner 2002-05-10 05:38:18 +00:00
parent e291226f02
commit 6a4fa1c8b5
3 changed files with 43 additions and 0 deletions

View File

@ -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) $<

View File

@ -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
}

View File

@ -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
}