// REQUIRES: asserts
// RUN: %clang_cc1 -no-opaque-pointers -x objective-c -emit-llvm -triple x86_64-apple-macosx10.10.0 -fsanitize=nullability-return,returns-nonnull-attribute,nullability-arg,nonnull-attribute %s -o - -w | FileCheck %s
// If both the annotation and the attribute are present, prefer the attribute,
// since it actually affects IRGen.
// CHECK-LABEL: define{{.*}} nonnull i32* @f1
int *_Nonnull
// CHECK-LABEL: define{{.*}} void @f2
void
// CHECK-LABEL: define{{.*}} void @call_f2
void
// If the return value isn't meant to be checked, make sure we don't check it.
// CHECK-LABEL: define{{.*}} i32* @f3
int *
// Check for a valid "return" source location, even when there is no return
// statement, to avoid accidentally calling the runtime.
// CHECK-LABEL: define{{.*}} nonnull i32* @f4
int *