aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/nonnull-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/nonnull-1.c')
-rw-r--r--gcc/testsuite/c-c++-common/nonnull-1.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/testsuite/c-c++-common/nonnull-1.c b/gcc/testsuite/c-c++-common/nonnull-1.c
index fb2814c..2446d6f 100644
--- a/gcc/testsuite/c-c++-common/nonnull-1.c
+++ b/gcc/testsuite/c-c++-common/nonnull-1.c
@@ -24,5 +24,11 @@ func (char *cp1, char *cp2, char *cp3, char *cp4)
if (NULL != cp3) /* { dg-warning "nonnull argument" "cp3 compared to NULL" } */
return 3;
- return (cp4 != 0) ? 0 : 1; /* { dg-warning "nonnull argument" "cp4 compared to NULL" } */
+ return cp4 != 0 ? 0 : 1; /* { dg-warning "nonnull argument" "cp4 compared to NULL" } */
+}
+
+__attribute__((nonnull (1))) int
+func2 (char *cp)
+{
+ return (cp != NULL) ? 1 : 0; /* { dg-warning "nonnull argument" "cp compared to NULL" { xfail c++ } } */
}