summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/FunctionAttrs/nonnull.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs/nonnull.ll')
-rw-r--r--llvm/test/Transforms/FunctionAttrs/nonnull.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/nonnull.ll b/llvm/test/Transforms/FunctionAttrs/nonnull.ll
index 7a51cb32d6a..69f0b0dd550 100644
--- a/llvm/test/Transforms/FunctionAttrs/nonnull.ll
+++ b/llvm/test/Transforms/FunctionAttrs/nonnull.ll
@@ -458,4 +458,16 @@ define i32* @g1() {
ret i32* %c
}
+; ATTRIBUTOR: define internal void @called_by_weak(i32* nocapture nonnull %a)
+define internal void @called_by_weak(i32* %a) {
+ ret void
+}
+
+; Check we do not annotate the function interface of this weak function.
+; ATTRIBUTOR: define weak_odr void @weak_caller(i32* nonnull %a)
+define weak_odr void @weak_caller(i32* nonnull %a) {
+ call void @called_by_weak(i32* %a)
+ ret void
+}
+
attributes #0 = { "null-pointer-is-valid"="true" }
OpenPOWER on IntegriCloud