blob: e08c41ceeb8b2b22b029ce56706cae54aa20e711 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This testcase ensures that redundant loads are preserved when they are not
2; allowed to be eliminated.
3; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse | llvm-dis | grep sub
4;
5int %test1(int* %P) {
6 %A = load int* %P
7 store int 1, int* %P
8 %B = load int* %P
9 %C = sub int %A, %B
10 ret int %C
11}
12
13int %test2(int* %P) {
14 %A = load int* %P
15 br label %BB2
16BB2:
17 store int 5, int* %P
18 br label %BB3
19BB3:
20 %B = load int* %P
21 %C = sub int %A, %B
22 ret int %C
23}
24
25