diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2024-03-06 13:41:02 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@arm.com> | 2024-03-11 15:51:35 +0000 |
commit | c27b30552e6cc789425d3628d294dafc5f3a0861 (patch) | |
tree | 0b4f1122edae05f25182b69050a26d235cee02a1 /gcc | |
parent | 8410402272038aae7e4b2bd76df38607a78cad95 (diff) | |
download | gcc-c27b30552e6cc789425d3628d294dafc5f3a0861.zip gcc-c27b30552e6cc789425d3628d294dafc5f3a0861.tar.gz gcc-c27b30552e6cc789425d3628d294dafc5f3a0861.tar.bz2 |
gomp: testsuite: improve compatibility of bad-array-section-3.c [PR113428]
This test generates different warnings on ilp32 targets because the size
of an integer matches the size of a pointer. Avoid this by using
signed char.
gcc/testsuite:
PR testsuite/113428
* gcc.dg/gomp/bad-array-section-c-3.c: Use signed char instead
of int.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c b/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c index 8be15ce..431af71 100644 --- a/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c +++ b/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c @@ -1,15 +1,15 @@ /* { dg-do compile } */ struct S { - int *ptr; + signed char *ptr; }; int main() { - int arr[20]; + signed char arr[20]; /* Reject array section in compound initialiser. */ -#pragma omp target map( (struct S) { .ptr = (int *) arr[5:5] } ) +#pragma omp target map( (struct S) { .ptr = (signed char *) arr[5:5] } ) /* { dg-error {expected '\]' before ':' token} "" { target *-*-* } .-1 } */ /* { dg-warning {cast to pointer from integer of different size} "" { target *-*-* } .-2 } */ /* { dg-message {sorry, unimplemented: unsupported map expression} "" { target *-*-* } .-3 } */ |