summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c99-restrict-1.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-17 08:25:51 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-17 08:25:51 +0000
commitabffed6865e0688fcadbf11b4597b12dc59641a0 (patch)
treee827b4dc57ae5e195740f501b640468fe1dac1ad /gcc/testsuite/gcc.dg/c99-restrict-1.c
parent62af9abe48f0036f0afa8dfe5a76710d854771e2 (diff)
downloadgcc-abffed6865e0688fcadbf11b4597b12dc59641a0.tar.gz
* gcc.dg/c90-enum-comma-1.c, gcc.dg/c90-idem-qual-1.c,
gcc.dg/c90-impl-decl-1.c, gcc.dg/c90-impl-int-1.c, gcc.dg/c90-longlong.c, gcc.dg/c90-restrict-1.c, gcc.dg/c90-return-1.c, gcc.dg/c99-enum-comma-1.c, gcc.dg/c99-idem-qual-1.c, gcc.dg/c99-impl-decl-1.c, gcc.dg/c99-impl-int-1.c, gcc.dg/c99-longlong-1.c, gcc.dg/c99-restrict-1.c, gcc.dg/c99-return-1.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35073 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/c99-restrict-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/c99-restrict-1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c99-restrict-1.c b/gcc/testsuite/gcc.dg/c99-restrict-1.c
new file mode 100644
index 00000000000..30ddd96bdcc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c99-restrict-1.c
@@ -0,0 +1,19 @@
+/* Test for restrict: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+char *restrict foo;
+
+/* The following are constraint violations and should be rejected. */
+
+int restrict bar; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "restrict" "restrict constraint violation" { target *-*-* } 10 } */
+
+typedef void (*fp) (void);
+
+fp restrict baz; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "restrict" "restrict constraint violation" { target *-*-* } 15 } */
+
+void quux (int restrict a[3]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "restrict" "restrict constraint violation" { target *-*-* } 18 } */