]> granicus.if.org Git - llvm/commitdiff
[InstCombine] add test to show potential nonnull attribute propagation; NFC
authorSanjay Patel <spatel@rotateright.com>
Sun, 1 Jan 2017 17:18:00 +0000 (17:18 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 1 Jan 2017 17:18:00 +0000 (17:18 +0000)
This will change with the current draft of:
https://reviews.llvm.org/D28204

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290797 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/call_nonnull_arg.ll

index 58cf3bcb7560e9d44d321ccf4282e03686dfa88e..adbae0af2832ef8025c0c884943d458d963dd8b7 100644 (file)
@@ -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
+}
+