blob: 50a3256d1979aa307088427b7042e1292cf5d79d [file] [log] [blame]
Chris Lattner5abaa0c2002-05-16 01:03:12 +00001; This testcase ensures that redundant loads are preserved when they are not
2; allowed to be eliminated.
3; RUN: as < %s | dis > Output/%s.before
4; RUN: as < %s | opt -gcse | dis > Output/%s.after
5; RUN: diff Output/%s.before Output/%s.after
6;
7int "test1"(int* %P) {
8 %A = load int* %P
9 store int 1, int * %P
10 %B = load int* %P
11 %C = add int %A, %B
12 ret int %C
13}
14
15int "test2"(int* %P) {
16 %A = load int* %P
17 br label %BB2
18BB2:
19 store int 5, int * %P
20 br label %BB3
21BB3:
22 %B = load int* %P
23 %C = add int %A, %B
24 ret int %C
25}
26
27