blob: a8b1bf9f45dff7dab5dfaf4e256f6b13eb443cb8 [file] [log] [blame]
Chris Lattner5abaa0c2002-05-16 01:03:12 +00001; This testcase ensures that redundant loads are eliminated when they should
2; be. All RL variables (redundant loads) should be eliminated.
3;
4; RUN: if as < %s | opt -gcse | dis | grep %RL
5; RUN: then exit 1
6; RUN: else exit 0
7; RUN: fi
8;
9int "test1"(int* %P) {
10 %A = load int* %P
11 %RL = load int* %P
12 %C = add int %A, %RL
13 ret int %C
14}
15
16int "test2"(int* %P) {
17 %A = load int* %P
18 br label %BB2
19BB2:
20 br label %BB3
21BB3:
22 %RL = load int* %P
23 %B = add int %A, %RL
24 ret int %B
25}
26