diff gcc/testsuite/gcc.dg/Wc99-c11-compat-7.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/Wc99-c11-compat-7.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors -Wc99-c11-compat" } */
+
+struct S { int i; struct { int a; }; }; /* { dg-error "ISO C99 doesn.t support unnamed structs/unions" } */
+_Noreturn void foo (void); /* { dg-error "ISO C99 does not support ._Noreturn." } */
+typedef int A;
+typedef int A; /* { dg-error "redefinition of typedef .A." } */
+_Thread_local int i; /* { dg-error "ISO C99 does not support ._Thread_local." } */
+_Static_assert (1, "foo"); /* { dg-error "ISO C99 does not support ._Static_assert." } */
+_Atomic int a; /* { dg-error "ISO C99 does not support the ._Atomic. qualifier" } */
+_Alignas (int) int aa; /* { dg-error "ISO C99 does not support ._Alignas." } */
+enum e { E = _Alignof (double) }; /* { dg-error "ISO C99 does not support ._Alignof." } */
+
+void
+fn (int n)
+{
+  _Generic (n, int: 0); /* { dg-error "ISO C99 does not support ._Generic." } */
+}