blob: 510997de22fcc7213e07762e6725d6fd430fddc9 [file] [log] [blame]
Chris Lattnerdbcc2f72005-03-25 15:36:19 +00001; RUN: llvm-as < %s | opt -ds-aa -load-vn -gcse | llvm-dis | grep 'load int\* %L'
Chris Lattner4e59c642005-03-24 17:57:43 +00002
3%G = internal global int* null
4
5int %caller(bool %P) {
6 %L = alloca int
7 call void %callee(bool %P, int* %L)
8
9 ;; At this point, G could point to L, so we can't eliminate these operations.
10 %GP = load int** %G
11 store int 17, int* %L
12 store int 18, int* %GP ;; might clober L
13
14 %A = load int* %L ;; is not necessarily 17!
15 ret int %A
16}
17
18internal void %callee(bool %Cond, int* %P) {
19 br bool %Cond, label %T, label %F
20T:
21 store int* %P, int** %G
22 ret void
23F:
24 ret void
25}
26