aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c
new file mode 100644
index 000000000..70fcd79a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c
@@ -0,0 +1,14 @@
+/* Source: EMC. */
+
+/* { dg-do compile } */
+/* -fpack-struct is necessary because the warning expected requires the initial
+ packing to be larger than 1, which cannot be guaranteed for all targets.
+ We won't get a warning anyway if the target has "packed" structure
+ layout. */
+/* { dg-options "-Wpadded -fpack-struct=8" } */
+/* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */
+
+struct foo {
+ char bar;
+ long baz; /* { dg-warning "padding struct to align" "" { target { ! default_packed } } } */
+} futz;