diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-03 21:40:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-03 21:40:14 +0000 |
commit | 1cdfd83d627ae7138f85f0333475b665b50a944e (patch) | |
tree | 2895f718188c7f1eea2afe2e13ec701fabca3b96 | |
parent | df142f0bd0b75b264a9ee1c9841e80aa04bac874 (diff) |
Check field sensitivity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5483 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/DSGraph/gcsetest.ll | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/test/Analysis/DSGraph/gcsetest.ll b/test/Analysis/DSGraph/gcsetest.ll index d451ed5017..f6d4b57b53 100644 --- a/test/Analysis/DSGraph/gcsetest.ll +++ b/test/Analysis/DSGraph/gcsetest.ll @@ -20,12 +20,22 @@ implementation ret %intpair* %C } +int* %getp(%intpair* %P) { + %pp = getelementptr %intpair* %P, long 0, ubyte 0 + %V = load int** %pp + ret int *%V +} + +int* %getq(%intpair* %P) { + %pp = getelementptr %intpair* %P, long 0, ubyte 1 + %V = load int** %pp + ret int *%V +} + int %test() { %C = call %intpair* %alloc_pair() - %C1p = getelementptr %intpair* %C, long 0, ubyte 0 - %C2p = getelementptr %intpair* %C, long 0, ubyte 1 - %A = load int** %C1p - %B = load int** %C2p + %A = call int* %getp(%intpair* %C) + %B = call int* %getp(%intpair* %C) %A1 = load int* %A store int 123, int* %B ; Store cannot alias %A @@ -35,12 +45,6 @@ int %test() { ret int %ELIM_x } -int* %getp(%intpair* %P) { - %pp = getelementptr %intpair* %P, long 0, ubyte 0 - %V = load int** %pp - ret int *%V -} - int %test2() { ; Test context sensitivity %C1 = call %intpair* %alloc_pair() %C2 = call %intpair* %alloc_pair() @@ -53,3 +57,13 @@ int %test2() { ; Test context sensitivity ret int %ELIM_x } +int %test3() { + %C = call %intpair* %alloc_pair() + %P1 = call int* %getp(%intpair* %C) + %P2 = call int* %getq(%intpair* %C) + %X = load int* %P1 + store int 7, int* %P2 + %Y = load int* %P1 + %ELIM_x = sub int %X, %Y ; Check field sensitivity + ret int %ELIM_x +} |