From: Georg-Johann Lay Date: Fri, 2 Feb 2018 11:36:54 +0000 (+0000) Subject: re PR testsuite/52641 (Test cases fail for 16-bit int targets) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c1aec7e2679c07ad109db27fbee433215e8e2af;p=gcc.git re PR testsuite/52641 (Test cases fail for 16-bit int targets) PR testsuite/52641 * gcc.c-torture/execute/pr81913.c: Use types that also work for int16. * gcc.c-torture/execute/20180112-1.c: Dito. * gcc.c-torture/execute/pr81503.c: Dito. * gcc.dg/store_merging_12.c: Dito. * gcc.dg/tree-ssa/loop-niter-1.c: Dito. * gcc.dg/tree-ssa/loop-niter-2.c: Dito. * gcc.dg/tree-ssa/pr80898.c: Dito. * gcc.dg/tree-ssa/pr82363.c: Dito. * gcc.dg/utf16-4.c: Also allow "short unsigned int" in dg-warning. * gcc.dg/tree-ssa/pr81346-5.c: Special-case int16. * gcc.dg/tree-ssa/ssa-sink-11.c: Dito. * gcc.dg/tree-ssa/ssa-sink-12.c: Dito. * gcc.dg/torture/pr81814.c: Restrict to int32plus. * gcc.dg/tree-ssa/pr80803.c: Dito. * gcc.dg/tree-ssa/pr80898-2.c: Dito. * gcc.dg/tree-ssa/pr81346-4.c: Dito. * gcc.dg/tree-ssa/vrp114.c: Dito. * gcc.dg/tree-ssa/pr82574.c: Restrict to size32plus. * gcc.dg/tree-ssa/ssa-dom-thread-13.c: Dito. * gcc.dg/tree-ssa/ssa-sink-15.c: Dito. From-SVN: r257327 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 15c3e06ff63..6bc8ede0314 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,27 @@ +2018-02-02 Georg-Johann Lay + + PR testsuite/52641 + * gcc.c-torture/execute/pr81913.c: Use types that also work for int16. + * gcc.c-torture/execute/20180112-1.c: Dito. + * gcc.c-torture/execute/pr81503.c: Dito. + * gcc.dg/store_merging_12.c: Dito. + * gcc.dg/tree-ssa/loop-niter-1.c: Dito. + * gcc.dg/tree-ssa/loop-niter-2.c: Dito. + * gcc.dg/tree-ssa/pr80898.c: Dito. + * gcc.dg/tree-ssa/pr82363.c: Dito. + * gcc.dg/utf16-4.c: Also allow "short unsigned int" in dg-warning. + * gcc.dg/tree-ssa/pr81346-5.c: Special-case int16. + * gcc.dg/tree-ssa/ssa-sink-11.c: Dito. + * gcc.dg/tree-ssa/ssa-sink-12.c: Dito. + * gcc.dg/torture/pr81814.c: Restrict to int32plus. + * gcc.dg/tree-ssa/pr80803.c: Dito. + * gcc.dg/tree-ssa/pr80898-2.c: Dito. + * gcc.dg/tree-ssa/pr81346-4.c: Dito. + * gcc.dg/tree-ssa/vrp114.c: Dito. + * gcc.dg/tree-ssa/pr82574.c: Restrict to size32plus. + * gcc.dg/tree-ssa/ssa-dom-thread-13.c: Dito. + * gcc.dg/tree-ssa/ssa-sink-15.c: Dito. + 2018-02-02 Igor Tsimbalist PR target/84066 diff --git a/gcc/testsuite/gcc.c-torture/execute/20180112-1.c b/gcc/testsuite/gcc.c-torture/execute/20180112-1.c index 6752661ecb6..d01ac72db88 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20180112-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20180112-1.c @@ -3,7 +3,7 @@ extern void abort (void); -typedef unsigned int u32; +typedef __UINT32_TYPE__ u32; u32 bug (u32 * result) __attribute__((noinline)); u32 bug (u32 * result) diff --git a/gcc/testsuite/gcc.c-torture/execute/pr81503.c b/gcc/testsuite/gcc.c-torture/execute/pr81503.c index 5fc6cb0e83c..aaa77077fcf 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr81503.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr81503.c @@ -1,11 +1,20 @@ unsigned short a = 41461; unsigned short b = 3419; +#if __SIZEOF_INT__ >= 4 int c = 0; void foo() { if (a + b * ~(0 != 5)) c = -~(b * ~(0 != 5)) + 2147483647; } +#else +__INT32_TYPE__ c = 0; + +void foo() { + if (a + b * ~((__INT32_TYPE__)(0 != 5))) + c = -~(b * ~((__INT32_TYPE__)(0 != 5))) + 2147483647; +} +#endif int main() { foo(); diff --git a/gcc/testsuite/gcc.c-torture/execute/pr81913.c b/gcc/testsuite/gcc.c-torture/execute/pr81913.c index 11eec4e1eaf..c8338f404ab 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr81913.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr81913.c @@ -1,7 +1,7 @@ /* PR tree-optimization/81913 */ -typedef unsigned char u8; -typedef unsigned int u32; +typedef __UINT8_TYPE__ u8; +typedef __UINT32_TYPE__ u32; static u32 b (u8 d, u32 e, u32 g) diff --git a/gcc/testsuite/gcc.dg/store_merging_12.c b/gcc/testsuite/gcc.dg/store_merging_12.c index 67f23449e93..2a74f3d12b5 100644 --- a/gcc/testsuite/gcc.dg/store_merging_12.c +++ b/gcc/testsuite/gcc.dg/store_merging_12.c @@ -1,6 +1,10 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Wall" } */ +#if __SIZEOF_INT__ == 2 +#define int long +#endif + struct S { unsigned int b1:1, b2:1, b3:1, b4:1, b5:1, b6:27; }; void bar (struct S *); void foo (int x) diff --git a/gcc/testsuite/gcc.dg/torture/pr81814.c b/gcc/testsuite/gcc.dg/torture/pr81814.c index aaf7c7f3041..16868c922fc 100644 --- a/gcc/testsuite/gcc.dg/torture/pr81814.c +++ b/gcc/testsuite/gcc.dg/torture/pr81814.c @@ -1,5 +1,5 @@ /* PR middle-end/81814 */ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ int main () diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-1.c index 16c76fe81bc..ccfbf1a815e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-1.c @@ -2,7 +2,7 @@ /* { dg-options "-O2 -fdump-tree-sccp-details" } */ typedef unsigned char u8; -typedef unsigned int u32; +typedef __UINT32_TYPE__ u32; static u32 b (u8 d, u32 e, u32 g) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-2.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-2.c index 2377e6caa72..764563662bb 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-niter-2.c @@ -2,7 +2,7 @@ /* { dg-options "-O2 -fdump-tree-sccp-details" } */ typedef unsigned char u8; -typedef unsigned int u32; +typedef __UINT32_TYPE__ u32; static u32 b (u8 d, u32 e, u32 g) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr80803.c b/gcc/testsuite/gcc.dg/tree-ssa/pr80803.c index 66834fb31fb..29a40c24cee 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr80803.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr80803.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ /* { dg-options "-O" } */ struct S0 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c index cb4799c5ced..6b245e5e8f7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr80898-2.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ /* { dg-options "-O2" } */ struct S0 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr80898.c b/gcc/testsuite/gcc.dg/tree-ssa/pr80898.c index ed88f2cbd1a..ca51590d010 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr80898.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr80898.c @@ -2,9 +2,9 @@ /* { dg-options "-O2" } */ struct S0 { - int f0 : 24; - int f1; - int f74; + __INT32_TYPE__ f0 : 24; + __INT32_TYPE__ f1; + __INT32_TYPE__ f74; } a, *c = &a; struct S0 fn1() { struct S0 b = {4, 3}; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr81346-4.c b/gcc/testsuite/gcc.dg/tree-ssa/pr81346-4.c index f93ad468c3f..8c56f26ce34 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr81346-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr81346-4.c @@ -1,5 +1,5 @@ /* PR tree-optimization/81346 */ -/* { dg-do run } */ +/* { dg-do run { target int32plus } } */ /* { dg-options "-O2" } */ #include "pr81346-3.c" diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr81346-5.c b/gcc/testsuite/gcc.dg/tree-ssa/pr81346-5.c index 14562a11152..4b822754e4e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr81346-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr81346-5.c @@ -1,7 +1,8 @@ /* PR tree-optimization/81346 */ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ -/* { dg-final { scan-tree-dump-times "\\(signed int\\) x" 10 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "\\(signed int\\) x" 10 "optimized" { target int32plus } } } */ +/* { dg-final { scan-tree-dump-times "\\(signed short\\) x" 10 "optimized" { target int16 } } } */ /* { dg-final { scan-tree-dump-times " <= 0;" 5 "optimized" } } */ /* { dg-final { scan-tree-dump-times " > 0;" 5 "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr82363.c b/gcc/testsuite/gcc.dg/tree-ssa/pr82363.c index 6652468976b..baeb9c3a2d1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr82363.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82363.c @@ -1,6 +1,10 @@ /* { dg-do run } */ /* { dg-options "-O" } */ +#if __SIZEOF_INT__ == 2 +#define int __INT32_TYPE__ +#endif + struct A { int b; @@ -34,6 +38,8 @@ test_l (void) __builtin_abort (); } +#undef int + int main () { while (1) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr82574.c b/gcc/testsuite/gcc.dg/tree-ssa/pr82574.c index 8fc459631ef..eb7427b5dfa 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr82574.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82574.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target size32plus } } */ /* { dg-options "-O3" } */ unsigned char a, b, c, d[200][200]; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c index 209c40d4c95..fd99bfbf789 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -fdump-tree-dom2-details -w" } */ union tree_node; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-11.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-11.c index 0f0b51e9b15..8fee2bf6469 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-11.c @@ -13,4 +13,5 @@ int foo (int v[], int a) return r; } -/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized"} } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized" { target int32plus } } } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 126B\\\]" "optimized" { target int16 } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-12.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-12.c index f6658a1c246..b63a6c2365d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-12.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-12.c @@ -14,4 +14,5 @@ int foo (int v1[], int v2[]) return r; } -/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized"} } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 252B\\\]" "optimized" { target int32plus } } } */ +/* { dg-final { scan-tree-dump "MEM\\\[.* \\+ 126B\\\]" "optimized" { target int16 } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-15.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-15.c index 66ddc4e6642..da6921ed6a3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-15.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-15.c @@ -1,5 +1,5 @@ /* PR79725 */ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ _Complex double f(_Complex double x[]) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp114.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp114.c index f465005b671..5c2c1a0b500 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp114.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp114.c @@ -1,4 +1,4 @@ -/* { dg-do link } */ +/* { dg-do link { target int32plus } } */ /* { dg-options "-O2 -fdump-tree-fre1 -fdump-tree-evrp" } */ extern void link_error (); diff --git a/gcc/testsuite/gcc.dg/utf16-4.c b/gcc/testsuite/gcc.dg/utf16-4.c index 4b203877dde..60e00f60ee4 100644 --- a/gcc/testsuite/gcc.dg/utf16-4.c +++ b/gcc/testsuite/gcc.dg/utf16-4.c @@ -12,7 +12,7 @@ char16_t c2 = u'\U00064321'; /* { dg-warning "constant too long" } */ char16_t c3 = 'a'; char16_t c4 = U'a'; char16_t c5 = U'\u2029'; -char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .(long )?unsigned int. to 'char16_t' {aka 'short unsigned int'} changes value from .410401. to .17185." } */ +char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .(long )?unsigned int. to 'char16_t' {aka '(short )?unsigned int'} changes value from .410401. to .17185." } */ char16_t c7 = L'a'; char16_t c8 = L'\u2029'; char16_t c9 = L'\U00064321'; /* { dg-warning "conversion" "" { target { 4byte_wchar_t } } } */