diff options
author | Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> | 2017-03-28 10:55:18 +0000 |
---|---|---|
committer | Senthil Kumar Selvaraj <saaadhu@gcc.gnu.org> | 2017-03-28 10:55:18 +0000 |
commit | 17722fb9e6f8c79c7016c68ea359d6fe2dd5aadd (patch) | |
tree | 3e99b7e467b519adc2fdf74c9a90c329b6da8562 /gcc | |
parent | 41f447177cd863ae2bdf8f77801517e8007b4e2b (diff) | |
download | gcc-17722fb9e6f8c79c7016c68ea359d6fe2dd5aadd.zip gcc-17722fb9e6f8c79c7016c68ea359d6fe2dd5aadd.tar.gz gcc-17722fb9e6f8c79c7016c68ea359d6fe2dd5aadd.tar.bz2 |
Fix broken tests for avr target
These tests assume {unsigned,} ints are 32 bits or wider. Explicitly
specify __{U}INT32_TYPE__ for targets with __SIZEOF_INT__ < 4.
gcc/testsuite/
2017-03-28 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.c-torture/execute/pr79121.c:Use __{U}INT32_TYPE__ for targets
with sizeof(int) < 4.
* gcc.c-torture/execute/pr79737-1.c (struct S): Likewise.
* gcc.c-torture/execute/pr79737-2.c: Likewise.
* gcc.dg/torture/pr79777.c: Likewise.
* gcc.dg/torture/pr79910.c: Likewise.
From-SVN: r246529
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr79121.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr79737-1.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr79737-2.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr79777.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr79910.c | 6 |
6 files changed, 55 insertions, 17 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4abe1dc..fe42af1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-03-28 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> + + * gcc.c-torture/execute/pr79121.c:Use __{U}INT32_TYPE__ for targets + with sizeof(int) < 4. + * gcc.c-torture/execute/pr79737-1.c (struct S): Likewise. + * gcc.c-torture/execute/pr79737-2.c: Likewise. + * gcc.dg/torture/pr79777.c: Likewise. + * gcc.dg/torture/pr79910.c: Likewise. + 2017-03-28 Richard Biener <rguenther@suse.de> PR middle-end/80222 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr79121.c b/gcc/testsuite/gcc.c-torture/execute/pr79121.c index 9fca7fb..5593acc 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr79121.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr79121.c @@ -1,21 +1,29 @@ +#if __SIZEOF_INT__ < 4 + __extension__ typedef __UINT32_TYPE__ uint32_t; + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef unsigned uint32_t; + typedef int int32_t; +#endif + extern void abort (void); -__attribute__ ((noinline, noclone)) unsigned long long f1 (int x) +__attribute__ ((noinline, noclone)) unsigned long long f1 (int32_t x) { return ((unsigned long long) x) << 4; } -__attribute__ ((noinline, noclone)) long long f2 (unsigned x) +__attribute__ ((noinline, noclone)) long long f2 (uint32_t x) { return ((long long) x) << 4; } -__attribute__ ((noinline, noclone)) unsigned long long f3 (unsigned x) +__attribute__ ((noinline, noclone)) unsigned long long f3 (uint32_t x) { return ((unsigned long long) x) << 4; } -__attribute__ ((noinline, noclone)) long long f4 (int x) +__attribute__ ((noinline, noclone)) long long f4 (int32_t x) { return ((long long) x) << 4; } diff --git a/gcc/testsuite/gcc.c-torture/execute/pr79737-1.c b/gcc/testsuite/gcc.c-torture/execute/pr79737-1.c index 05e392c..f7fa5f9 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr79737-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr79737-1.c @@ -1,13 +1,19 @@ /* PR tree-optimization/79737 */ +#if __SIZEOF_INT__ < 4 + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef int int32_t; +#endif + #pragma pack(1) struct S { - int b:18; - int c:1; - int d:24; - int e:15; - int f:14; + int32_t b:18; + int32_t c:1; + int32_t d:24; + int32_t e:15; + int32_t f:14; } i; int g, j, k; static struct S h; diff --git a/gcc/testsuite/gcc.c-torture/execute/pr79737-2.c b/gcc/testsuite/gcc.c-torture/execute/pr79737-2.c index 37b991e..56a6ad8 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr79737-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr79737-2.c @@ -1,13 +1,19 @@ /* PR tree-optimization/79737 */ +#if __SIZEOF_INT__ < 4 + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef int int32_t; +#endif + #pragma pack(1) struct S { - int b:18; - int c:1; - int d:24; - int e:15; - int f:14; + int32_t b:18; + int32_t c:1; + int32_t d:24; + int32_t e:15; + int32_t f:14; } i, j; void diff --git a/gcc/testsuite/gcc.dg/torture/pr79777.c b/gcc/testsuite/gcc.dg/torture/pr79777.c index eb1bec7..40d6740 100644 --- a/gcc/testsuite/gcc.dg/torture/pr79777.c +++ b/gcc/testsuite/gcc.dg/torture/pr79777.c @@ -1,9 +1,14 @@ /* { dg-do compile } */ typedef unsigned short __u16; -typedef unsigned int __u32; +#if __SIZEOF_INT__ < 4 + __extension__ typedef __UINT32_TYPE__ __u32; + __extension__ typedef __UINT32_TYPE__ u32; +#else + typedef unsigned int __u32; + typedef unsigned int u32; +#endif typedef unsigned char u8; -typedef unsigned int u32; typedef __u16 __le16; typedef __u32 __le32; typedef u32 secno; diff --git a/gcc/testsuite/gcc.dg/torture/pr79910.c b/gcc/testsuite/gcc.dg/torture/pr79910.c index 5fe80ae..280dda1 100644 --- a/gcc/testsuite/gcc.dg/torture/pr79910.c +++ b/gcc/testsuite/gcc.dg/torture/pr79910.c @@ -2,7 +2,11 @@ /* { dg-additional-options "-fweb" } */ typedef unsigned char u8; -typedef unsigned int u32; +#if __SIZEOF_INT__ < 4 + __extension__ typedef __UINT32_TYPE__ u32; +#else + typedef unsigned int u32; +#endif typedef unsigned long long u64; int a; |