llvm.org GIT mirror llvm / 89bf005
New testcase for GCSE git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2342 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
2 changed file(s) with 67 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0
1 LEVEL = ../../../..
2 include $(LEVEL)/test/Makefile.tests
3
4 TESTS := $(wildcard *.ll)
5
6 all:: $(addprefix Output/, $(TESTS:%.ll=%.ll.out))
7
8 Output/%.ll.out: %.ll Output/.dir $(LOPT)
9 -$(TESTRUNR) $<
0 ; Various test cases to ensure basic functionality is working for GCSE
1
2 ; RUN: as < %s | opt -gcse
3
4 implementation
5
6 void "testinsts"(int %i, int %j, int* %p)
7 begin
8 %A = cast int %i to uint
9 %B = cast int %i to uint
10
11 %C = shl int %i, ubyte 1
12 %D = shl int %i, ubyte 1
13
14 %E = getelementptr int* %p, uint 12
15 %F = getelementptr int* %p, uint 12
16 %G = getelementptr int* %p, uint 13
17 ret void
18 end
19
20
21 ; Test different combinations of domination properties...
22 void "sameBBtest"(int %i, int %j)
23 begin
24 %A = add int %i, %j
25 %B = add int %i, %j
26
27 %C = not int %A
28 %D = not int %B
29 %E = not int %j
30
31 ret void
32 end
33
34 int "dominates"(int %i, int %j)
35 begin
36 %A = add int %i, %j
37 br label %BB2
38
39 BB2:
40 %B = add int %i, %j
41 ret int %B
42 end
43
44 int "hascommondominator"(int %i, int %j)
45 begin
46 br bool true, label %BB1, label %BB2
47
48 BB1:
49 %A = add int %i, %j
50 ret int %A
51
52 BB2:
53 %B = add int %i, %j
54 ret int %B
55 end
56