summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2015-01-21 22:39:35 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2015-01-21 22:39:35 +0000
commita1255d3a74f38616a1f9bc1b38b69c82aa46b4da (patch)
tree3c47bf08875af80f3b40f48a1eb786d6347c1dca /llvm/test
parent2144377536789210a07e0725269e6aee10c245c9 (diff)
downloadbcm5719-llvm-a1255d3a74f38616a1f9bc1b38b69c82aa46b4da.tar.gz
bcm5719-llvm-a1255d3a74f38616a1f9bc1b38b69c82aa46b4da.zip
Added test to cover the CFLAA bitset indexing bug.
llvm-svn: 226710
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Analysis/CFLAliasAnalysis/stratified-attrs-indexing.ll33
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/Analysis/CFLAliasAnalysis/stratified-attrs-indexing.ll b/llvm/test/Analysis/CFLAliasAnalysis/stratified-attrs-indexing.ll
new file mode 100644
index 00000000000..8afedf2e139
--- /dev/null
+++ b/llvm/test/Analysis/CFLAliasAnalysis/stratified-attrs-indexing.ll
@@ -0,0 +1,33 @@
+; This testcase ensures that CFLAA doesn't try to access out of bounds indices
+; when given functions with large amounts of arguments (specifically, more
+; arguments than the StratifiedAttrs bitset can handle)
+;
+; Because the result on failure is effectively crashing the compiler, output
+; checking is minimal.
+
+; RUN: opt < %s -cfl-aa -aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
+
+; CHECK: Function: test
+define void @test(i1 %cond,
+ i32* %arg1, i32* %arg2, i32* %arg3, i32* %arg4, i32* %arg5,
+ i32* %arg6, i32* %arg7, i32* %arg8, i32* %arg9, i32* %arg10,
+ i32* %arg11, i32* %arg12, i32* %arg13, i32* %arg14, i32* %arg15,
+ i32* %arg16, i32* %arg17, i32* %arg18, i32* %arg19, i32* %arg20,
+ i32* %arg21, i32* %arg22, i32* %arg23, i32* %arg24, i32* %arg25,
+ i32* %arg26, i32* %arg27, i32* %arg28, i32* %arg29, i32* %arg30,
+ i32* %arg31, i32* %arg32, i32* %arg33, i32* %arg34, i32* %arg35) {
+
+ ; CHECK: 946 Total Alias Queries Performed
+ ; CHECK: 810 no alias responses (85.6%)
+ %a = alloca i32, align 4
+ %b = select i1 %cond, i32* %arg35, i32* %arg34
+ %c = select i1 %cond, i32* %arg34, i32* %arg33
+ %d = select i1 %cond, i32* %arg33, i32* %arg32
+ %e = select i1 %cond, i32* %arg32, i32* %arg31
+ %f = select i1 %cond, i32* %arg31, i32* %arg30
+ %g = select i1 %cond, i32* %arg30, i32* %arg29
+ %h = select i1 %cond, i32* %arg29, i32* %arg28
+ %i = select i1 %cond, i32* %arg28, i32* %arg27
+
+ ret void
+}
OpenPOWER on IntegriCloud