aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/2009-02-11-NotInitialized.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/2009-02-11-NotInitialized.ll')
-rw-r--r--test/Transforms/InstCombine/2009-02-11-NotInitialized.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2009-02-11-NotInitialized.ll b/test/Transforms/InstCombine/2009-02-11-NotInitialized.ll
new file mode 100644
index 0000000000..b66495d9cb
--- /dev/null
+++ b/test/Transforms/InstCombine/2009-02-11-NotInitialized.ll
@@ -0,0 +1,14 @@
+; RUN: opt < %s -inline -instcombine -functionattrs | llvm-dis
+;
+; Check that nocapture attributes are added when run after an SCC pass.
+; PR3520
+
+define i32 @use(i8* %x) nounwind readonly {
+; CHECK: @use(i8* nocapture %x)
+ %1 = tail call i64 @strlen(i8* %x) nounwind readonly
+ %2 = trunc i64 %1 to i32
+ ret i32 %2
+}
+
+declare i64 @strlen(i8*) nounwind readonly
+; CHECK: declare i64 @strlen(i8* nocapture) nounwind readonly