diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-08 17:52:47 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-08 17:52:47 +0000 |
commit | 005927ac5d0090e0405b3401fbeee84251f091ff (patch) | |
tree | 01747a73ce7036ad011a130b219a7c40b14c4515 /gcc/testsuite/gcc.dg | |
parent | da9055d29af60e521b94ef9d06e5e99f4e79e6a9 (diff) | |
download | gcc-005927ac5d0090e0405b3401fbeee84251f091ff.tar.gz |
2008-12-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r142553
2008-12-08 Basile Starynkevitch <basile@starynkevitch.net>
* gcc/Makefile.in: using BACKENDLIBS as merged from trunk r142553
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@142557 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/dfp/fe-binop.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/dfp/fe-convert-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr38338.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr38405.c | 29 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/union-5.c | 46 |
8 files changed, 102 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c index 409120f2a40..1fef7947c9b 100644 --- a/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c +++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c @@ -8,3 +8,6 @@ int foo() *(long*)&i = 0; /* { dg-warning "type-punn" } */ return i; } + +/* { dg-message "does break strict-aliasing" "" { target { *-*-* && lp64 } } 8 } */ +/* { dg-message "initialized" "" { target { *-*-* && lp64 } } 8 } */ diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c index 73719157411..fccc178d224 100644 --- a/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c +++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c @@ -11,12 +11,12 @@ int foo() { float* r; if (flag) { - q = (float*) &x; /* { dg-warning "type-punn" "" { xfail *-*-* } } */ + q = (float*) &x; /* { dg-message "initialized" } */ } else { - q = (float*) &y; /* { dg-warning "type-punn" "" { xfail *-*-* } } */ + q = (float*) &y; /* { dg-message "initialized" } */ } - *q = 1.0; + *q = 1.0; /* { dg-warning "does break strict-aliasing" } */ return x; diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c index 87867fad8b2..9833abb7ff0 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c @@ -1,4 +1,5 @@ /* { dg-options "-O0 -std=gnu99" } */ +/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */ /* N1150 5.2: Conversions among decimal floating types and between decimal floating types and generic floating types. diff --git a/gcc/testsuite/gcc.dg/dfp/fe-binop.c b/gcc/testsuite/gcc.dg/dfp/fe-binop.c index 007bc6e44dd..23f137818ed 100644 --- a/gcc/testsuite/gcc.dg/dfp/fe-binop.c +++ b/gcc/testsuite/gcc.dg/dfp/fe-binop.c @@ -1,4 +1,5 @@ /* { dg-options "-std=gnu99" } */ +/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */ /* Touch tests that check for raising appropriate exceptions for binary arithmetic operations on decimal float values. */ diff --git a/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c b/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c index 6ea632d427f..f65cf7870ae 100644 --- a/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c +++ b/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c @@ -1,4 +1,5 @@ /* { dg-options "-std=gnu99" } */ +/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */ /* Check that appropriate exceptions are raised for conversions involving decimal float values. */ diff --git a/gcc/testsuite/gcc.dg/pr38338.c b/gcc/testsuite/gcc.dg/pr38338.c new file mode 100644 index 00000000000..e8fcc3c4504 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr38338.c @@ -0,0 +1,18 @@ +/* PR middle-end/38338 */ +/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fPIC" { target fpic } } */ + +typedef void (*fnp) (void); + +static char +foo (char x) +{ + return x; +} + +static void * +bar (char x) +{ + void *args = __builtin_apply_args (); + return __builtin_apply ((fnp) foo, args, sizeof (void *)); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr38405.c b/gcc/testsuite/gcc.dg/torture/pr38405.c new file mode 100644 index 00000000000..3f93445cd65 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr38405.c @@ -0,0 +1,29 @@ +/* { dg-do run } */ + +extern void abort (); +extern int printf (char *__format, ...); + +struct vpiBinaryConst { + int signed_flag :1; + int sized_flag :1; +}; + +int binary_get(int code, struct vpiBinaryConst *rfp) +{ + switch (code) { + case 1: + return rfp->signed_flag ? 1 : 0; + default: + printf("error: %d not supported\n", code); + return code; + } +} + +int main(void) +{ + struct vpiBinaryConst x={1,0}; + int y=binary_get(1, &x); + if (y!=1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/union-5.c b/gcc/testsuite/gcc.dg/union-5.c new file mode 100644 index 00000000000..ea65f4b0273 --- /dev/null +++ b/gcc/testsuite/gcc.dg/union-5.c @@ -0,0 +1,46 @@ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O -fgcse -fno-split-wide-types" } */ + +extern void abort(void); + +typedef unsigned short int uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; + +typedef struct +{ + uint16_t thread; + uint16_t phase; +} s32; + +typedef union +{ + uint32_t i; + s32 s; +} u32; + +typedef union +{ + uint64_t i; + u32 u; +} u64; + +static __attribute__((noinline)) +void foo(int val) +{ + u64 data; + uint32_t thread; + + data.u.i = 0x10000L; + thread = data.u.s.thread; + if (val) + abort (); + if (thread) + abort (); +} + +int main(void) +{ + foo (0); + return 0; +} |