aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-23 01:46:59 +0000
committerChris Lattner <sabre@nondot.org>2005-03-23 01:46:59 +0000
commitad46cf028294bbaeedef21821ba552f2b175d28c (patch)
treea4c73b41e4b08a09cf5ec3c5ef6dc18a7e1440e0 /test
parent7c61b7b6ea249700bca5ab1dd2f0e5eaa2a2d3a8 (diff)
downloadexternal_llvm-ad46cf028294bbaeedef21821ba552f2b175d28c.zip
external_llvm-ad46cf028294bbaeedef21821ba552f2b175d28c.tar.gz
external_llvm-ad46cf028294bbaeedef21821ba552f2b175d28c.tar.bz2
new testcase to verify that we have field sensitive alias analysis info. This
test cannot be satisfied without interprocedural information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/DSGraph/field-sensitive.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Analysis/DSGraph/field-sensitive.ll b/test/Analysis/DSGraph/field-sensitive.ll
new file mode 100644
index 0000000..dc3fc22
--- /dev/null
+++ b/test/Analysis/DSGraph/field-sensitive.ll
@@ -0,0 +1,21 @@
+; Test that ds-aa can be used for queries that require field sensitive AA.
+; RUN: llvm-as < %s | opt -no-aa -ds-aa -load-vn -gcse | llvm-dis | not grep load
+
+%Pair = type { int, int }
+
+implementation
+
+%Pair* %id(%Pair* %P) { ret %Pair *%P }
+
+int %foo() {
+ %X = alloca %Pair
+ %XP = call %Pair* %id(%Pair* %X)
+
+ %F1 = getelementptr %Pair* %X, int 0, uint 0
+ %F2 = getelementptr %Pair* %XP, int 0, uint 1
+ store int 14, int* %F1
+ store int 0, int* %F2 ; no alias F1
+ %B = load int* %F1 ; Should eliminate load!
+ ret int %B
+}
+