mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
New testcase for GCSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2342 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
923caadfab
commit
89bf005646
10
test/Transforms/GCSE/Makefile
Normal file
10
test/Transforms/GCSE/Makefile
Normal 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) $<
|
57
test/Transforms/GCSE/gcsetests.ll
Normal file
57
test/Transforms/GCSE/gcsetests.ll
Normal file
@ -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
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user