Initial checkin of testcases for Pi node inserter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2590 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-05-10 05:38:18 +00:00
parent 3af3ba8b38
commit 8832c1e853
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
}