aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/ScalarEvolution/pr22179.ll
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2015-03-23 12:10:34 -0700
committerStephen Hines <srhines@google.com>2015-03-23 12:10:34 -0700
commitebe69fe11e48d322045d5949c83283927a0d790b (patch)
treec92f1907a6b8006628a4b01615f38264d29834ea /test/Analysis/ScalarEvolution/pr22179.ll
parentb7d2e72b02a4cb8034f32f8247a2558d2434e121 (diff)
downloadexternal_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.zip
external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.gz
external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.bz2
Update aosp/master LLVM for rebase to r230699.
Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
Diffstat (limited to 'test/Analysis/ScalarEvolution/pr22179.ll')
-rw-r--r--test/Analysis/ScalarEvolution/pr22179.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/pr22179.ll b/test/Analysis/ScalarEvolution/pr22179.ll
new file mode 100644
index 0000000..d9fb510
--- /dev/null
+++ b/test/Analysis/ScalarEvolution/pr22179.ll
@@ -0,0 +1,28 @@
+; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
+
+%struct.anon = type { i8 }
+%struct.S = type { i32 }
+
+@a = common global %struct.anon zeroinitializer, align 1
+@b = common global %struct.S zeroinitializer, align 4
+
+; Function Attrs: nounwind ssp uwtable
+define i32 @main() {
+; CHECK-LABEL: Classifying expressions for: @main
+ store i8 0, i8* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 1
+ br label %loop
+
+loop:
+ %storemerge1 = phi i8 [ 0, %0 ], [ %inc, %loop ]
+ %m = load volatile i32* getelementptr inbounds (%struct.S* @b, i64 0, i32 0), align 4
+ %inc = add nuw i8 %storemerge1, 1
+; CHECK: %inc = add nuw i8 %storemerge1, 1
+; CHECK-NEXT: --> {1,+,1}<nuw><%loop>
+; CHECK-NOT: --> {1,+,1}<nuw><nsw><%loop>
+ %exitcond = icmp eq i8 %inc, -128
+ br i1 %exitcond, label %exit, label %loop
+
+exit:
+ store i8 -128, i8* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 1
+ ret i32 0
+}