diff options
-rw-r--r-- | gcc/testsuite/gcc.dg/alignof.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/alignof.c b/gcc/testsuite/gcc.dg/alignof.c new file mode 100644 index 00000000000..d018b44025d --- /dev/null +++ b/gcc/testsuite/gcc.dg/alignof.c @@ -0,0 +1,11 @@ +/* PR c/69507 - bogus warning: ISO C does not allow '__alignof__ (expression)' + */ +/* { dg-do compile } */ +/* { dg-options "-std=c11 -Wno-error -Wpedantic" } */ + +extern int e; + +int a[] = { + __alignof__ (e), + _Alignof (e) /* { dg-warning "ISO C does not allow ._Alignof \\(expression\\)." } */ +}; |