From af0c51ac87ab2a87caa03fa108f0d164987a2764 Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Thu, 28 Mar 2013 11:14:20 -0700 Subject: [GCC 4.8] Initial check-in of GCC 4.8.0 Change-Id: I0719d8a6d0f69b367a6ab6f10eb75622dbf12771 --- gcc-4.8/gcc/testsuite/gcc.dg/nonnull-2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gcc-4.8/gcc/testsuite/gcc.dg/nonnull-2.c (limited to 'gcc-4.8/gcc/testsuite/gcc.dg/nonnull-2.c') diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/nonnull-2.c b/gcc-4.8/gcc/testsuite/gcc.dg/nonnull-2.c new file mode 100644 index 000000000..bd36d232d --- /dev/null +++ b/gcc-4.8/gcc/testsuite/gcc.dg/nonnull-2.c @@ -0,0 +1,16 @@ +/* Test for the invalid use of the "nonnull" function attribute. */ +/* Origin: Jason Thorpe */ +/* { dg-do compile } */ + +extern void func1 () __attribute__((nonnull)); /* { dg-error "without arguments" } */ + +extern void func2 (char *) __attribute__((nonnull(2))); /* { dg-error "out-of-range operand" } */ + +extern void func3 (char *) __attribute__((nonnull(foo))); /* { dg-error "invalid operand number" } */ + +extern void func4 (int) __attribute__((nonnull(1))); /* { dg-error "references non-pointer" } */ + +void +foo (void) +{ +} -- cgit v1.2.3