blob: d3414880cd23f04ab3137d6c6a0845cec6cf77b7 [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
Chris Lattner1a242822002-08-30 20:18:09 +00004; RUN: as < %s | opt -load-vn -gcse | dis > Output/%s.after
5; RUN: echo some output
Chris Lattner5abaa0c2002-05-16 01:03:12 +00006; RUN: diff Output/%s.before Output/%s.after
7;
8int "test1"(int* %P) {
9 %A = load int* %P
10 store int 1, int * %P
11 %B = load int* %P
12 %C = add int %A, %B
13 ret int %C
14}
15
16int "test2"(int* %P) {
17 %A = load int* %P
18 br label %BB2
19BB2:
20 store int 5, int * %P
21 br label %BB3
22BB3:
23 %B = load int* %P
24 %C = add int %A, %B
25 ret int %C
26}
27
28