The test case assumes that alignof(int)=sizeof(int). But for some targets this is not valid. For example, for PRU target, alignof(int)=1 but sizeof(int)=4.
Fix the test case to align to twice the size of int, as the expected dg-error messages suggest. This patch fixes the test failures for PRU target. Ok for trunk? gcc/testsuite/ChangeLog: * gcc.dg/pr116357.c: Use sizeof(int) instead of alignof(int). Cc: Jakub Jelinek <ja...@redhat.com> Signed-off-by: Dimitar Dimitrov <dimi...@dinux.eu> --- gcc/testsuite/gcc.dg/pr116357.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/pr116357.c b/gcc/testsuite/gcc.dg/pr116357.c index 07effa13254..12aaf62c20d 100644 --- a/gcc/testsuite/gcc.dg/pr116357.c +++ b/gcc/testsuite/gcc.dg/pr116357.c @@ -2,9 +2,9 @@ /* { dg-do compile } */ /* { dg-options "" } */ -typedef int A __attribute__((aligned (2 * alignof (int)))); +typedef int A __attribute__((aligned (2 * sizeof (int)))); A a[4]; /* { dg-error "alignment of array elements is greater than element size" } */ -typedef volatile int B __attribute__((aligned (2 * alignof (int)))); +typedef volatile int B __attribute__((aligned (2 * sizeof (int)))); B b[4]; /* { dg-error "alignment of array elements is greater than element size" } */ -typedef const int C __attribute__((aligned (2 * alignof (int)))); +typedef const int C __attribute__((aligned (2 * sizeof (int)))); C c[4]; /* { dg-error "alignment of array elements is greater than element size" } */ -- 2.48.1