From 63a6e7748540715f73c2ed9f81e537f35f352d60 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 22 Apr 2003 22:00:15 +0000 Subject: [PATCH] New testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5857 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/BasicAA/2003-04-22-GEPProblem.ll | 15 +++++++++++++++ test/Transforms/BasicAA/2003-04-22-GEPProblem.ll | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/Analysis/BasicAA/2003-04-22-GEPProblem.ll create mode 100644 test/Transforms/BasicAA/2003-04-22-GEPProblem.ll diff --git a/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll b/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll new file mode 100644 index 00000000000..27ec9ea6944 --- /dev/null +++ b/test/Analysis/BasicAA/2003-04-22-GEPProblem.ll @@ -0,0 +1,15 @@ +; RUN: as < %s | opt -load-vn -gcse -instcombine | dis | grep sub + +; BasicAA was incorrectly concluding that P1 and P2 didn't conflict! + +int %test(int *%Ptr, long %V) { + %P2 = getelementptr int* %Ptr, long 1 + %P1 = getelementptr int* %Ptr, long %V + %X = load int* %P1 + store int 5, int* %P2 + + %Y = load int* %P1 + + %Z = sub int %X, %Y + ret int %Z +} diff --git a/test/Transforms/BasicAA/2003-04-22-GEPProblem.ll b/test/Transforms/BasicAA/2003-04-22-GEPProblem.ll new file mode 100644 index 00000000000..27ec9ea6944 --- /dev/null +++ b/test/Transforms/BasicAA/2003-04-22-GEPProblem.ll @@ -0,0 +1,15 @@ +; RUN: as < %s | opt -load-vn -gcse -instcombine | dis | grep sub + +; BasicAA was incorrectly concluding that P1 and P2 didn't conflict! + +int %test(int *%Ptr, long %V) { + %P2 = getelementptr int* %Ptr, long 1 + %P1 = getelementptr int* %Ptr, long %V + %X = load int* %P1 + store int 5, int* %P2 + + %Y = load int* %P1 + + %Z = sub int %X, %Y + ret int %Z +} -- 2.34.1