aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-27 00:07:42 +0000
committerChris Lattner <sabre@nondot.org>2010-02-27 00:07:42 +0000
commitd38cdb020ec534417e644a0962b7668525e7f658 (patch)
tree8d830da7d61c745fc5ccb00bdae019fa55f2a995 /test/Transforms
parente9fd444dcd59f5b17bd30f919cb1b3a50519d3c1 (diff)
downloadexternal_llvm-d38cdb020ec534417e644a0962b7668525e7f658.zip
external_llvm-d38cdb020ec534417e644a0962b7668525e7f658.tar.gz
external_llvm-d38cdb020ec534417e644a0962b7668525e7f658.tar.bz2
fix PR6414, a nondeterminism issue in IPSCCP which was because
of a subtle interation in a loop operating in densemap order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/SCCP/retvalue-undef.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Transforms/SCCP/retvalue-undef.ll b/test/Transforms/SCCP/retvalue-undef.ll
new file mode 100644
index 0000000..389561f
--- /dev/null
+++ b/test/Transforms/SCCP/retvalue-undef.ll
@@ -0,0 +1,32 @@
+; RUN: opt -ipsccp -S %s | FileCheck %s
+; PR6414
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define internal i32 ()* @f() {
+ ret i32 ()* @g
+}
+
+define internal i32 @g() {
+ ret i32 8
+}
+
+; CHECK: internal i32 @g()
+; CHECK-NEXT: ret i32 8
+
+define internal void @outer_mod() {
+ %1 = call i32 ()* ()* @f() ; <i32 ()*> [#uses=1]
+ %2 = call i32 %1() ; <i32> [#uses=0]
+ ret void
+}
+
+define internal void @module_init() {
+ call void @register_outer_mod(void ()* @outer_mod)
+ ret void
+}
+
+declare void @register_outer_mod(void ()*)
+
+define i32 @main() {
+ ret i32 0
+}