blob: dc3fc22dfb822695f2990d5be06231aec365e252 [file] [log] [blame]
Chris Lattnerad46cf02005-03-23 01:46:59 +00001; Test that ds-aa can be used for queries that require field sensitive AA.
2; RUN: llvm-as < %s | opt -no-aa -ds-aa -load-vn -gcse | llvm-dis | not grep load
3
4%Pair = type { int, int }
5
6implementation
7
8%Pair* %id(%Pair* %P) { ret %Pair *%P }
9
10int %foo() {
11 %X = alloca %Pair
12 %XP = call %Pair* %id(%Pair* %X)
13
14 %F1 = getelementptr %Pair* %X, int 0, uint 0
15 %F2 = getelementptr %Pair* %XP, int 0, uint 1
16 store int 14, int* %F1
17 store int 0, int* %F2 ; no alias F1
18 %B = load int* %F1 ; Should eliminate load!
19 ret int %B
20}
21