diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-28 01:46:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-28 01:46:36 +0000 |
commit | 89bf0056463d3c302976e6a0af94d09b301d705a (patch) | |
tree | 8219531416667106f2d99e68d5ea4580f8f5ca81 | |
parent | 923caadfab5e638f54d044b3c9012c514c4323a2 (diff) |
New testcase for GCSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2342 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Transforms/GCSE/Makefile | 10 | ||||
-rw-r--r-- | test/Transforms/GCSE/gcsetests.ll | 57 |
2 files changed, 67 insertions, 0 deletions
diff --git a/test/Transforms/GCSE/Makefile b/test/Transforms/GCSE/Makefile new file mode 100644 index 0000000000..91acd4d481 --- /dev/null +++ b/test/Transforms/GCSE/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/GCSE/gcsetests.ll b/test/Transforms/GCSE/gcsetests.ll new file mode 100644 index 0000000000..10b00694ef --- /dev/null +++ b/test/Transforms/GCSE/gcsetests.ll @@ -0,0 +1,57 @@ +; Various test cases to ensure basic functionality is working for GCSE + +; RUN: as < %s | opt -gcse + +implementation + +void "testinsts"(int %i, int %j, int* %p) +begin + %A = cast int %i to uint + %B = cast int %i to uint + + %C = shl int %i, ubyte 1 + %D = shl int %i, ubyte 1 + + %E = getelementptr int* %p, uint 12 + %F = getelementptr int* %p, uint 12 + %G = getelementptr int* %p, uint 13 + ret void +end + + +; Test different combinations of domination properties... +void "sameBBtest"(int %i, int %j) +begin + %A = add int %i, %j + %B = add int %i, %j + + %C = not int %A + %D = not int %B + %E = not int %j + + ret void +end + +int "dominates"(int %i, int %j) +begin + %A = add int %i, %j + br label %BB2 + +BB2: + %B = add int %i, %j + ret int %B +end + +int "hascommondominator"(int %i, int %j) +begin + br bool true, label %BB1, label %BB2 + +BB1: + %A = add int %i, %j + ret int %A + +BB2: + %B = add int %i, %j + ret int %B +end + |