summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-01-01 17:18:00 +0000
committerSanjay Patel <spatel@rotateright.com>2017-01-01 17:18:00 +0000
commit07537c2b6e6856122a73c1b9e9a32d0efe685989 (patch)
treef3a0667df7b9caa54ace90da7fa872f680920782 /llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
parentf872d230ad35c2fead29a89989f1b22201361e5f (diff)
downloadbcm5719-llvm-07537c2b6e6856122a73c1b9e9a32d0efe685989.tar.gz
bcm5719-llvm-07537c2b6e6856122a73c1b9e9a32d0efe685989.zip
[InstCombine] add test to show potential nonnull attribute propagation; NFC
This will change with the current draft of: https://reviews.llvm.org/D28204 llvm-svn: 290797
Diffstat (limited to 'llvm/test/Transforms/InstCombine/call_nonnull_arg.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/call_nonnull_arg.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll b/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
index 58cf3bcb756..adbae0af283 100644
--- a/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
+++ b/llvm/test/Transforms/InstCombine/call_nonnull_arg.ll
@@ -31,3 +31,17 @@ dead:
unreachable
}
+declare void @bar(i8*, i8* nonnull)
+declare void @baz(i8*, i8*)
+
+define void @deduce_nonnull_from_another_call(i8* %a, i8* %b) {
+; CHECK-LABEL: @deduce_nonnull_from_another_call(
+; CHECK-NEXT: call void @bar(i8* %a, i8* %b)
+; CHECK-NEXT: call void @baz(i8* %b, i8* %b)
+; CHECK-NEXT: ret void
+;
+ call void @bar(i8* %a, i8* %b)
+ call void @baz(i8* %b, i8* %b)
+ ret void
+}
+
OpenPOWER on IntegriCloud