aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDimitar Dimitrov <dimitar@dinux.eu>2025-01-29 19:43:15 +0200
committerDimitar Dimitrov <dimitar@dinux.eu>2025-04-18 17:53:14 +0300
commit6b635f84c4e973c873cf49f99d87b0fe22d3f5f5 (patch)
tree4235b20667a0f2cfdf71e98e900278721e5d66d4 /gcc
parent1f7ac78efa622e19f38d6a45e857941b3dea1437 (diff)
downloadgcc-6b635f84c4e973c873cf49f99d87b0fe22d3f5f5.zip
gcc-6b635f84c4e973c873cf49f99d87b0fe22d3f5f5.tar.gz
gcc-6b635f84c4e973c873cf49f99d87b0fe22d3f5f5.tar.bz2
testsuite: Use int size instead of alignment for pr116357.c
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. gcc/testsuite/ChangeLog: * gcc.dg/pr116357.c: Use sizeof(int) instead of alignof(int). Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/pr116357.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/pr116357.c b/gcc/testsuite/gcc.dg/pr116357.c
index 07effa1..12aaf62 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" } */