From 584d9d585bf041ec45fa1a8c2c4e30f015b29f1a Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Fri, 2 Feb 2018 15:07:37 +0000 Subject: [PATCH] re PR testsuite/52641 (Test cases fail for 16-bit int targets) PR testsuite/52641 * gcc.c-torture/execute/pr83362.c: Make work for int16. * gcc.dg/Wsign-conversion.c: Dito. * gcc.dg/attr-alloc_size-4.c: Dito. * gcc.dg/pr81020.c: Dito. * gcc.dg/pr81192.c: Dito. * gcc.dg/pr83463.c (dg-options): Add -Wno-pointer-to-int-cast. * gcc.dg/attr-alloc_size-11.c: Also special-case avr. * gcc.dg/pr83844.c: Restrict to int32plus. * gcc.dg/attr-alloc_size-3.c: Restrict to size32plus. * gcc.dg/tree-ssa/ldist-25.c: Dito. * gcc.dg/tree-ssa/ldist-27.c: Dito. * gcc.dg/tree-ssa/ldist-28.c: Dito. * gcc.dg/tree-ssa/ldist-29.c: Dito. * gcc.dg/tree-ssa/ldist-30.c: Dito. * gcc.dg/tree-ssa/ldist-31.c: Dito. * gcc.dg/tree-ssa/ldist-32.c: Dito. * gcc.dg/tree-ssa/ldist-33.c: Dito. * gcc.dg/tree-ssa/ldist-34.c: Dito. * gcc.dg/tree-ssa/ldist-35.c: Dito. * gcc.dg/tree-ssa/ldist-36.c: Dito. From-SVN: r257333 --- gcc/testsuite/ChangeLog | 24 +++++++++++++++++++ gcc/testsuite/gcc.c-torture/execute/pr83362.c | 4 ++-- gcc/testsuite/gcc.dg/Wsign-conversion.c | 6 +++-- gcc/testsuite/gcc.dg/attr-alloc_size-11.c | 4 ++-- gcc/testsuite/gcc.dg/attr-alloc_size-3.c | 2 +- gcc/testsuite/gcc.dg/attr-alloc_size-4.c | 2 +- gcc/testsuite/gcc.dg/pr81020.c | 4 ++++ gcc/testsuite/gcc.dg/pr81192.c | 5 ++++ gcc/testsuite/gcc.dg/pr83463.c | 2 +- gcc/testsuite/gcc.dg/pr83844.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-25.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-28.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-29.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-30.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-31.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-33.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c | 2 +- 21 files changed, 56 insertions(+), 21 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a9e5d030ea8..39222bbd311 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/pr83362.c: Make work for int16. + * gcc.dg/Wsign-conversion.c: Dito. + * gcc.dg/attr-alloc_size-4.c: Dito. + * gcc.dg/pr81020.c: Dito. + * gcc.dg/pr81192.c: Dito. + * gcc.dg/pr83463.c (dg-options): Add -Wno-pointer-to-int-cast. + * gcc.dg/attr-alloc_size-11.c: Also special-case avr. + * gcc.dg/pr83844.c: Restrict to int32plus. + * gcc.dg/attr-alloc_size-3.c: Restrict to size32plus. + * gcc.dg/tree-ssa/ldist-25.c: Dito. + * gcc.dg/tree-ssa/ldist-27.c: Dito. + * gcc.dg/tree-ssa/ldist-28.c: Dito. + * gcc.dg/tree-ssa/ldist-29.c: Dito. + * gcc.dg/tree-ssa/ldist-30.c: Dito. + * gcc.dg/tree-ssa/ldist-31.c: Dito. + * gcc.dg/tree-ssa/ldist-32.c: Dito. + * gcc.dg/tree-ssa/ldist-33.c: Dito. + * gcc.dg/tree-ssa/ldist-34.c: Dito. + * gcc.dg/tree-ssa/ldist-35.c: Dito. + * gcc.dg/tree-ssa/ldist-36.c: Dito. + 2018-02-02 Julia Koval * gcc.target/i386/funcspec-56.inc: Handle new march. diff --git a/gcc/testsuite/gcc.c-torture/execute/pr83362.c b/gcc/testsuite/gcc.c-torture/execute/pr83362.c index 54350819c56..900ea9ae4de 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr83362.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr83362.c @@ -1,5 +1,5 @@ -typedef unsigned char u8; -typedef unsigned int u32; +typedef __UINT8_TYPE__ u8; +typedef __UINT32_TYPE__ u32; u32 a, b, d, e; u8 c; diff --git a/gcc/testsuite/gcc.dg/Wsign-conversion.c b/gcc/testsuite/gcc.dg/Wsign-conversion.c index bda61eb8bbf..b2affd01912 100644 --- a/gcc/testsuite/gcc.dg/Wsign-conversion.c +++ b/gcc/testsuite/gcc.dg/Wsign-conversion.c @@ -10,11 +10,13 @@ void fsc (signed char sc); void fuc (unsigned char uc); unsigned fui (unsigned int ui); void fsi (signed int ui); +void fsi32 (__INT32_TYPE__ ui); void h (int x) { unsigned int ui = 3; int si = 3; + __INT32_TYPE__ si32 = 3; unsigned char uc = 3; signed char sc = 3; @@ -60,8 +62,8 @@ void h (int x) uc = '\xa0'; /* { dg-warning "unsigned conversion" } */ fui ('\xa0');/* { dg-warning "unsigned conversion" } */ ui = '\xa0'; /* { dg-warning "unsigned conversion" } */ - fsi (0x80000000); /* { dg-warning "signed conversion" } */ - si = 0x80000000; /* { dg-warning "signed conversion" } */ + fsi32 (0x80000000); /* { dg-warning "signed conversion" } */ + si32 = 0x80000000; /* { dg-warning "signed conversion" } */ fsi (UINT_MAX - 1); /* { dg-warning "conversion" } */ diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c index 6e109955183..3ec44dc1463 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-11.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-11.c @@ -47,8 +47,8 @@ typedef __SIZE_TYPE__ size_t; /* The following tests fail because of missing range information. The xfail exclusions are PR79356. */ -TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* } } } } */ -TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* } } } } */ +TEST (signed char, SCHAR_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for signed char" { xfail { ! { aarch64*-*-* arm*-*-* avr-*-* alpha*-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390*-*-* visium-*-* } } } } */ +TEST (short, SHRT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" "missing range info for short" { xfail { ! { aarch64*-*-* arm*-*-* alpha*-*-* avr-*-* ia64-*-* mips*-*-* powerpc*-*-* sparc*-*-* s390x-*-* visium-*-* } } } } */ TEST (int, INT_MIN + 2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */ TEST (int, -3, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */ TEST (int, -2, ALLOC_MAX); /* { dg-warning "argument 1 range \\\[13, \[0-9\]+\\\] exceeds maximum object size 12" } */ diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-3.c b/gcc/testsuite/gcc.dg/attr-alloc_size-3.c index a124a8791ad..3be88867202 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-3.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-3.c @@ -5,7 +5,7 @@ functions decorated with attribute alloc_size that either overflow or exceed the default maximum object size (with -Walloc-size-larger-than not explicitly specified). */ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -Wall" } */ #define SCHAR_MAX __SCHAR_MAX__ diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-4.c b/gcc/testsuite/gcc.dg/attr-alloc_size-4.c index fd7d7ade772..cafcfe38225 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-4.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-4.c @@ -162,7 +162,7 @@ test_size_cst (void) sink (f_size_2 ( 0, 1234)); sink (f_size_2 ( 1, 1234)); sink (f_size_2 ( 2, 1234)); /* { dg-warning "product .2 \\* 1234. of arguments 1 and 2 exceeds maximum object size \[0-9\]+" } */ - sink (f_size_2 (1234, 1234)); /* { dg-warning "product .1234 \\* 1234. of arguments 1 and 2 exceeds maximum object size 1234" } */ + sink (f_size_2 (1234, 1234)); /* { dg-warning "product .1234 \\* 1234. of arguments 1 and 2 exceeds (.SIZE_MAX.|maximum object size 1234)" } */ sink (f_size_2 (1235, 1234)); /* { dg-warning "argument 1 value .1235. exceeds maximum object size 1234" } */ sink (f_size_2 (1234, 1235)); /* { dg-warning "argument 2 value .1235. exceeds maximum object size 1234" } */ sink (f_size_2 (1234, max)); /* { dg-warning "argument 2 value .\[0-9\]+. exceeds maximum object size 1234" } */ diff --git a/gcc/testsuite/gcc.dg/pr81020.c b/gcc/testsuite/gcc.dg/pr81020.c index 8789c657a2f..4c70236d88f 100644 --- a/gcc/testsuite/gcc.dg/pr81020.c +++ b/gcc/testsuite/gcc.dg/pr81020.c @@ -7,7 +7,11 @@ unsigned v = 4; unsigned long long __attribute__((noipa)) foo (unsigned x) { +#if __SIZEOF_INT__ == 2 + __UINT32_TYPE__ a = v; +#else unsigned a = v; +#endif a &= 1; x |= 0 < a; a >>= 31; diff --git a/gcc/testsuite/gcc.dg/pr81192.c b/gcc/testsuite/gcc.dg/pr81192.c index 57eb4781d4d..0049f371b3d 100644 --- a/gcc/testsuite/gcc.dg/pr81192.c +++ b/gcc/testsuite/gcc.dg/pr81192.c @@ -1,5 +1,10 @@ /* { dg-options "-Os -fdump-tree-pre-details" } */ +#if __SIZEOF_INT__ == 2 +#define unsigned __UINT32_TYPE__ +#define int __INT32_TYPE__ +#endif + unsigned a; int b, c; diff --git a/gcc/testsuite/gcc.dg/pr83463.c b/gcc/testsuite/gcc.dg/pr83463.c index 735ef3c6dc8..ddf662f76a1 100644 --- a/gcc/testsuite/gcc.dg/pr83463.c +++ b/gcc/testsuite/gcc.dg/pr83463.c @@ -1,6 +1,6 @@ /* PR middle-end/83463 */ /* { dg-do compile } */ -/* { dg-options "-O2 -Wrestrict" } */ +/* { dg-options "-O2 -Wrestrict -Wno-pointer-to-int-cast" } */ int *a; void *memcpy (); diff --git a/gcc/testsuite/gcc.dg/pr83844.c b/gcc/testsuite/gcc.dg/pr83844.c index c6db68af2c5..fdbc1912fb9 100644 --- a/gcc/testsuite/gcc.dg/pr83844.c +++ b/gcc/testsuite/gcc.dg/pr83844.c @@ -1,5 +1,5 @@ /* PR c/83844 */ -/* { dg-do compile } */ +/* { dg-do compile { target int32plus } } */ /* { dg-options "-O0 -Wall" } */ typedef unsigned long long __u64 __attribute__((aligned(4),warn_if_not_aligned(8))); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-25.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-25.c index c0b95fc38ec..784dfd5dd4c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-25.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-25.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O3 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define k 1335 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c index f59e9096d2c..fa8bdfba2fc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target size32plus } } */ /* { dg-options "-O3 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ /* { dg-skip-if "too big data segment" { visium-*-* } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-28.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-28.c index 4420139dedb..d2492375dc8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-28.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-28.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define M (256) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-29.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-29.c index 9ce93e80b07..108fcf69833 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-29.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-29.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define M (256) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-30.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-30.c index f31860a574e..8619a0cf558 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-30.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-30.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define M (256) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-31.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-31.c index 60a9f743b1b..bd8c7641144 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-31.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-31.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define M (256) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c index 477d222fb3b..e8539d225a8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-32.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define M (256) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-33.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-33.c index 24d27fde9da..9e0cedf4fa3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-33.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-33.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define N (1024) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c index 3d68a851f57..3e37b304932 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution" } */ #define X (3.0) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c index 445d23d114b..a265b82f7c6 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-35.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define M (256) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c index 0e843f4dd55..07393f0a665 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-36.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target size32plus } } */ /* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ #define M (256) -- 2.30.2