aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/non-null-warning.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/non-null-warning.c')
-rw-r--r--test/Sema/non-null-warning.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/Sema/non-null-warning.c b/test/Sema/non-null-warning.c
index 024ef1eca667..7dfa3900cbb5 100644
--- a/test/Sema/non-null-warning.c
+++ b/test/Sema/non-null-warning.c
@@ -37,6 +37,9 @@ int * ret_nonnull() {
return 0; // expected-warning {{null returned from function that requires a non-null return value}}
}
+#define SAFE_CALL(X) if (X) foo(X)
int main () {
foo(0); // expected-warning {{null passed to a callee that requires a non-null argument}}
+ (void)sizeof(foo(0)); // expect no diagnostic in unevaluated context.
+ SAFE_CALL(0); // expect no diagnostic for unreachable code.
}