From 8832c1e853a15e86d8a19d42824a9b7f44e9893a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 10 May 2002 05:38:18 +0000 Subject: [PATCH] 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 --- test/Transforms/PiNodeInserter/Makefile | 10 ++++++++++ .../Transforms/PiNodeInserter/substitutetest.ll | 16 ++++++++++++++++ test/Transforms/PiNodeInserter/test.ll | 17 +++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 test/Transforms/PiNodeInserter/Makefile create mode 100644 test/Transforms/PiNodeInserter/substitutetest.ll create mode 100644 test/Transforms/PiNodeInserter/test.ll diff --git a/test/Transforms/PiNodeInserter/Makefile b/test/Transforms/PiNodeInserter/Makefile new file mode 100644 index 00000000000..91acd4d481b --- /dev/null +++ b/test/Transforms/PiNodeInserter/Makefile @@ -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) $< diff --git a/test/Transforms/PiNodeInserter/substitutetest.ll b/test/Transforms/PiNodeInserter/substitutetest.ll new file mode 100644 index 00000000000..2c103b995ab --- /dev/null +++ b/test/Transforms/PiNodeInserter/substitutetest.ll @@ -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 +} diff --git a/test/Transforms/PiNodeInserter/test.ll b/test/Transforms/PiNodeInserter/test.ll new file mode 100644 index 00000000000..5b0e5451da1 --- /dev/null +++ b/test/Transforms/PiNodeInserter/test.ll @@ -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 +} -- 2.34.1