aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-10-25 09:04:53 +0000
committerNick Clifton <nickc@gcc.gnu.org>2013-10-25 09:04:53 +0000
commit2e30c7fbc4eb5a58caae9fd2ed1cd05b60bdcec5 (patch)
treecc6bd7d67e025ac615ac9f9b036f48b5556d86fe /gcc/testsuite
parente86a8146c74c2f1642a7a2b27033fe900e4129ad (diff)
downloadgcc-2e30c7fbc4eb5a58caae9fd2ed1cd05b60bdcec5.zip
gcc-2e30c7fbc4eb5a58caae9fd2ed1cd05b60bdcec5.tar.gz
gcc-2e30c7fbc4eb5a58caae9fd2ed1cd05b60bdcec5.tar.bz2
pr57793.c: Add expected error messages for targets with small integers.
* c-c++-common/pr57793.c: Add expected error messages for targets with small integers. * gcc.dg/c99-stdint-1.c: Only run on 32-bit plus targets. * gcc.dg/c99-stdint-2.c: Likewise. * gcc.dg/cdce1.c: Likewise. * gcc.dg/fold-overflow-1.c: Likewise. * gcc.dg/utf-cvt.c: Likewise. * gcc.dg/ftrapv-1.c: Only run on targets that support trapping arithmetic. * gcc.dg/ftrapv-2.c: Likewise. * gcc.dg/pr30286.c: Likewise. * gcc.dg/pr19340.c: Only run on targets that support scheduling. * lib/target-supports.exp (check_effective_target_trapping): New proc. Returns true if the target supports trapping arithmetic. From-SVN: r204053
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog18
-rw-r--r--gcc/testsuite/c-c++-common/pr57793.c4
-rw-r--r--gcc/testsuite/gcc.dg/c99-stdint-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/c99-stdint-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cdce1.c3
-rw-r--r--gcc/testsuite/gcc.dg/fold-overflow-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ftrapv-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/ftrapv-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr19340.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr30286.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr38364.c1
-rw-r--r--gcc/testsuite/gcc.dg/utf-cvt.c2
-rw-r--r--gcc/testsuite/lib/target-supports.exp8
13 files changed, 39 insertions, 8 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6ffba19..3b99bfb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,21 @@
+2013-10-24 Nick Clifton <nickc@redhat.com>
+
+ * c-c++-common/pr57793.c: Add expected error messages for
+ targets with small integers.
+ * gcc.dg/c99-stdint-1.c: Only run on 32-bit plus targets.
+ * gcc.dg/c99-stdint-2.c: Likewise.
+ * gcc.dg/cdce1.c: Likewise.
+ * gcc.dg/fold-overflow-1.c: Likewise.
+ * gcc.dg/utf-cvt.c: Likewise.
+ * gcc.dg/ftrapv-1.c: Only run on targets that support trapping
+ arithmetic.
+ * gcc.dg/ftrapv-2.c: Likewise.
+ * gcc.dg/pr30286.c: Likewise.
+ * gcc.dg/pr19340.c: Only run on targets that support
+ scheduling.
+ * lib/target-supports.exp (check_effective_target_trapping): New
+ proc. Returns true if the target supports trapping arithmetic.
+
2013-10-25 Tobias Burnus <burnus@net-b.de>
* g++.dg/parse/ivdep.C: New.
diff --git a/gcc/testsuite/c-c++-common/pr57793.c b/gcc/testsuite/c-c++-common/pr57793.c
index d66fada..f271952 100644
--- a/gcc/testsuite/c-c++-common/pr57793.c
+++ b/gcc/testsuite/c-c++-common/pr57793.c
@@ -3,8 +3,8 @@
struct A { unsigned a : 1; unsigned b : 1; };
struct B /* { dg-error "type .B. is too large" "" { target { c++ && ilp32 } } } */
{
- unsigned char c[0x40000000];
- unsigned char d[0x40000ff0];
+ unsigned char c[0x40000000]; /* { dg-error "size of array .c. is too large" "" { target { ! int32plus } } } */
+ unsigned char d[0x40000ff0];/* { dg-error "size of array .d. is too large" "" { target { ! int32plus } } } */
struct A e;
}; /* { dg-error "type .struct B. is too large" "" { target { c && ilp32 } } } */
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-1.c b/gcc/testsuite/gcc.dg/c99-stdint-1.c
index 89bdec8..530d130 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-1.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-1.c
@@ -9,6 +9,7 @@
version). */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors -fhosted" } */
+/* { dg-require-effective-target ptr32plus } */
#include <limits.h>
#include <stdint.h>
@@ -214,7 +215,6 @@ test_max (void)
void
test_misc_limits (void)
{
-/* { dg-bogus "size" "ptrdiff is 16bits" { xfail avr-*-* } 56 } */
CHECK_SIGNED_LIMITS_2(__PTRDIFF_TYPE__, PTRDIFF_MIN, PTRDIFF_MAX, -65535L, 65535L);
#ifndef SIGNAL_SUPPRESS
CHECK_LIMITS_2(sig_atomic_t, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, -127, 127, 255);
diff --git a/gcc/testsuite/gcc.dg/c99-stdint-2.c b/gcc/testsuite/gcc.dg/c99-stdint-2.c
index d1be0fb..1784b0c 100644
--- a/gcc/testsuite/gcc.dg/c99-stdint-2.c
+++ b/gcc/testsuite/gcc.dg/c99-stdint-2.c
@@ -2,7 +2,7 @@
Freestanding version. */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors -ffreestanding" } */
-/* { dg-xfail-if "ptrdiff size is 16bits" { avr-*-* } } */
+/* { dg-require-effective-target ptr32plus } */
/* The test is that there are no diagnostics, so just include the
hosted version. */
#include "c99-stdint-1.c"
diff --git a/gcc/testsuite/gcc.dg/cdce1.c b/gcc/testsuite/gcc.dg/cdce1.c
index 3bd35ec..2123f7f 100644
--- a/gcc/testsuite/gcc.dg/cdce1.c
+++ b/gcc/testsuite/gcc.dg/cdce1.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
-/* { dg-final { scan-tree-dump "cdce1.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-final { scan-tree-dump "cdce1.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } } */
/* { dg-final { cleanup-tree-dump "cdce" } } */
/* { dg-require-effective-target large_double } */
diff --git a/gcc/testsuite/gcc.dg/fold-overflow-1.c b/gcc/testsuite/gcc.dg/fold-overflow-1.c
index 8fddc9f..4f45b35 100644
--- a/gcc/testsuite/gcc.dg/fold-overflow-1.c
+++ b/gcc/testsuite/gcc.dg/fold-overflow-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-skip-if "consts are shorts, not longs" { "m32c-*-*" "avr-*-*" } { "*" } { "" } } */
+/* { dg-require-effective-target int32plus } */
/* { dg-skip-if "No Inf support" { spu-*-* } } */
/* { dg-options "-O -ftrapping-math" } */
diff --git a/gcc/testsuite/gcc.dg/ftrapv-1.c b/gcc/testsuite/gcc.dg/ftrapv-1.c
index 44eb176..86bd802 100644
--- a/gcc/testsuite/gcc.dg/ftrapv-1.c
+++ b/gcc/testsuite/gcc.dg/ftrapv-1.c
@@ -7,6 +7,7 @@
/* { dg-do run } */
/* { dg-options "-ftrapv" } */
+/* { dg-require-effective-target trapping } */
__attribute__((noinline)) int
mulv(int a, int b)
diff --git a/gcc/testsuite/gcc.dg/ftrapv-2.c b/gcc/testsuite/gcc.dg/ftrapv-2.c
index d79b86d..7d76574 100644
--- a/gcc/testsuite/gcc.dg/ftrapv-2.c
+++ b/gcc/testsuite/gcc.dg/ftrapv-2.c
@@ -8,6 +8,7 @@
/* { dg-do run } */
/* { dg-options "-ftrapv" } */
+/* { dg-require-effective-target trapping } */
extern void abort(void);
extern long labs(long);
diff --git a/gcc/testsuite/gcc.dg/pr19340.c b/gcc/testsuite/gcc.dg/pr19340.c
index 4a66591..c75d35d 100644
--- a/gcc/testsuite/gcc.dg/pr19340.c
+++ b/gcc/testsuite/gcc.dg/pr19340.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fschedule-insns2 -fsched2-use-superblocks" } */
-/* { dg-skip-if "No scheduling" { mmix-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* m32c-*-* avr-*-* moxie-*-* } { "*" } { "" } } */
+/* { dg-require-effective-target scheduling } */
extern double f (double x);
diff --git a/gcc/testsuite/gcc.dg/pr30286.c b/gcc/testsuite/gcc.dg/pr30286.c
index 9ec49b4..d35eacd 100644
--- a/gcc/testsuite/gcc.dg/pr30286.c
+++ b/gcc/testsuite/gcc.dg/pr30286.c
@@ -1,6 +1,7 @@
/* PR middle-end/30286 */
/* { dg-do run } */
/* { dg-options "-O2 -ftrapv" } */
+/* { dg-require-effective-target trapping } */
extern void abort (void);
struct S { struct S *s; };
diff --git a/gcc/testsuite/gcc.dg/pr38364.c b/gcc/testsuite/gcc.dg/pr38364.c
index 23f72de..6b22e9d 100644
--- a/gcc/testsuite/gcc.dg/pr38364.c
+++ b/gcc/testsuite/gcc.dg/pr38364.c
@@ -1,6 +1,7 @@
/* PR middle-end/38364 */
/* { dg-do run } */
/* { dg-options "-O2 -ftrapv" } */
+/* { dg-require-effective-target trapping } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/utf-cvt.c b/gcc/testsuite/gcc.dg/utf-cvt.c
index 7f51179..d6f18ee 100644
--- a/gcc/testsuite/gcc.dg/utf-cvt.c
+++ b/gcc/testsuite/gcc.dg/utf-cvt.c
@@ -1,7 +1,7 @@
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test the char16_t and char32_t promotion rules. */
/* { dg-do compile } */
-/* { dg-excess-errors "short and int are 16bit" { target { "avr-*-*" } } } */
+/* { dg-require-effective-target int32plus } */
/* { dg-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */
typedef __CHAR16_TYPE__ char16_t;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8701cf6..5ca0b76 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -701,6 +701,14 @@ proc check_effective_target_scheduling {} {
} "-fschedule-insns"]
}
+# Return 1 if trapping arithmetic is available, 0 otherwise.
+
+proc check_effective_target_trapping {} {
+ return [check_no_compiler_messages scheduling object {
+ add (int a, int b) { return a + b; }
+ } "-ftrapv"]
+}
+
# Return 1 if compilation with -fgraphite is error-free for trivial
# code, 0 otherwise.