diff options
-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 +} |