diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-01 22:35:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-01 22:35:45 +0000 |
commit | b363312940668bea45a0de0d48945758868109f7 (patch) | |
tree | 419279c932f8690c00a1cb66992620c96db76c70 /test/Analysis | |
parent | e831b9a48bcf6f136044f1aed509eee3dee7d9d4 (diff) | |
download | llvm-b363312940668bea45a0de0d48945758868109f7.tar.gz llvm-b363312940668bea45a0de0d48945758868109f7.tar.bz2 llvm-b363312940668bea45a0de0d48945758868109f7.tar.xz |
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/GlobalsModRef/indirect-global.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Analysis/GlobalsModRef/indirect-global.ll b/test/Analysis/GlobalsModRef/indirect-global.ll new file mode 100644 index 0000000000..206955eba7 --- /dev/null +++ b/test/Analysis/GlobalsModRef/indirect-global.ll @@ -0,0 +1,23 @@ +; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | grep 'ret int 0' +%G = internal global int* null + +implementation + +void %test() { + %A = malloc int + store int* %A, int** %G + ret void +} + +int %test1(int *%P) { + %g1 = load int** %G + %h1 = load int* %g1 + + ; This store cannot alias either G or g1. + store int 123, int* %P + + %g2 = load int** %G + %h2 = load int* %g1 + %X = sub int %h1, %h2 ;; -> 0 + ret int %X +} |