aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr83844.c36
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9bc4d7b..ec9f469 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/83844
+ * gcc.dg/pr83844.c: New test.
+
2018-01-16 Richard Sandiford <richard.sandiford@linaro.org>
* gcc.dg/torture/pr83847.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr83844.c b/gcc/testsuite/gcc.dg/pr83844.c
new file mode 100644
index 0000000..c6db68a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr83844.c
@@ -0,0 +1,36 @@
+/* PR c/83844 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wall" } */
+
+typedef unsigned long long __u64 __attribute__((aligned(4),warn_if_not_aligned(8)));
+void bar (void *, void *, void *);
+
+void
+foo (int n)
+{
+ struct A
+ {
+ int i1;
+ int i2;
+ int i3[n];
+ __u64 x; /* { dg-warning "in 'struct A' may not be aligned to 8" } */
+ } __attribute__((aligned (8)));
+ struct B
+ {
+ int i1;
+ int i2;
+ long long i3[n];
+ __u64 x;
+ } __attribute__((aligned (8)));
+ struct C
+ {
+ int i1;
+ int i2;
+ int i3[2 * n];
+ __u64 x;
+ } __attribute__((aligned (8)));
+ struct A a;
+ struct B b;
+ struct C c;
+ bar (&a, &b, &c);
+}