diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-23 06:06:29 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-23 06:06:29 +0000 |
commit | 8a096472683581315df6e6747212356b3255087e (patch) | |
tree | dac105eba22e3c3a544b760bd2ca5b1db944f65e /gcc/testsuite | |
parent | 63217c8a41fa03e943e9859df194ab78cbe8639b (diff) | |
download | gcc-8a096472683581315df6e6747212356b3255087e.tar.gz |
2008-06-23 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r137030
* gcc/melt/warm-basilys.bysl: some primitives got explicit casts.
* gcc/basilys.h: added casts to avoid implicit conversion from void*
disallowed with C++
* gcc/basilys.c: (delete_special, forwarded, scanning) likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@137031 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
95 files changed, 2918 insertions, 109 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 333db9a73ca..71de4be63ce 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,219 @@ +2008-06-20 Joseph Myers <joseph@codesourcery.com> + + * gcc.dg/inline-31.c: New test. + +2008-06-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + * gfortran.dg/fmt_l.f90: Fix end of line test pattern. + +2008-06-19 Andy Hutchinson <hutchinsonandy@aim.com> + + * lib/target-supports.exp + (check_effective_target_keeps_null_pointer_checks) : New function. + * gcc.dg/tree-ssa/20030730-1.c: Use keeps_null_pointer_checks to + determine correct test response. + * gcc.dg/tree-ssa/20030730-2.c: Ditto. + * gcc.dg/tree-ssa/pr20701.c: Ditto. + * gcc.dg/tree-ssa/pr20702.c: Ditto. + * gcc.dg/tree-ssa/pr21086.c: Ditto. + * gcc.dg/tree-ssa/vrp02.c:: Ditto. + * gcc.dg/tree-ssa/vrp07.c:: Ditto. + * gcc.dg/tree-ssa/vrp08.c:: Ditto. + +2008-06-19 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.dg/pragma-pack-4.c: Skip for AVR target. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.dg/builtin-apply2.c: Mark skip for avr target. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + PR c/36571 + * gcc.dg/builtin-return-1.c: Mark as xfail on AVR. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.dg/tree-ssa/loop-35.c: xfail avr target. Add new avr specific + tests. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.dg/tree-ssa/forwprop-6.c: Use long or int to match size of + float. Otherwise error. + * gcc.dg/tree-ssa/ssa-fre-7.c: Ditto. + * gcc.dg/tree-ssa/ssa-fre-8.c: Ditto. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.c-torture/execute/20020619-1.c: Correct for targets + without 32 bit int. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.c-torture/execute/ieee/20000320-1.x: Skip for AVR target. + * gcc.c-torture/execute/ieee/rbug.x: Ditto. + * gcc.c-torture/execute/ieee/pr30704.x: Add new file. Skip for AVR + target. + * gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.x: Ditto. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + PR testsuite/36284 + * gcc.dg/compat/struct-layout-1_generate.c (switchfiles): Require + int32plus for generated main files. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + PR c/36460 + * gcc.dg/utf32-1.c: Mark xfail for AVR target. + * gcc.dg/utf32-2.c: Ditto. + * gcc.dg/utf32-3.c: Ditto. + +2008-06-18 Andy Hutchinson <hutchinsonandy@aim.com> + + * gcc.c-torture/compile/limits-fndefn.c: Skip for AVR. + * gcc.dg/builtins-config.h: Use standard independent __AVR__ symbol. + * gcc.dg/cdce1.c: Skip for AVR. + * gcc.dg/cdce2.c: Ditto. + * gcc.dg/fold-bitand-1.c: Ignore warnings such as alignment. + * gcc.dg/fold-eqandshift-3.c: Use long on AVR. + * gcc.dg/fold-overflow-1.c: Skip for AVR. + * gcc.dg/multiple-overflow-warn-3.c: Use target independent macro + for ms bit position. + * gcc.dg/pch/struct-1.c: Allow for target without 32 bit int. + * gcc.dg/tree-ssa/pr33920.c: Add warning check for AVR. + * gcc.dg/ucnid-5.c: Skip for AVR. + * gcc.dg/Wconversion-5.c: Mark warning xfail for AVR target. + * gcc.dg/Wconversion-real-integer.c: Skip for AVR. + * gcc.dg/Wconversion-real.c: Ditto. + * gcc.dg/wtr-conversion-1.c: Add warning test for AVR. + * gcc.dg/utf-cvt.c: Skip tests and mark excess xfail for AVR. + * gcc.dg/Wtype-limits-Wextra.c: Ditto. + * gcc.dg/Wtype-limits.c: Ditto. + +2008-06-18 Joseph Myers <joseph@codesourcery.com> + + * gcc.dg/dfp/convert-bfp-6.c, gcc.dg/dfp/convert-bfp-9.c: XFAIL + for lax_strtofp. + +2008-06-18 Joseph Myers <joseph@codesourcery.com> + + * lib/target-supports.exp + (check_effective_target_powerpc_hard_double): New. + * gcc.dg/tree-ssa/loop-19.c: Use powerpc_hard_double instead of + powerpc*-*-*. + +2008-06-16 Jan Hubicka <jh@suse.cz> + + * gcc.dg/weak/weak-2.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-3.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-4.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-5.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-6.c: Fix thinko in previous change. + * gcc.dg/weak/weak-7.c: Likewise. + +2008-06-16 Jan Hubicka <jh@suse.cz> + + * gcc.dg/asm-wide-1.c: Do not require extra errors we output + confused by earlier errors. + * gcc.target/i386/sseregparm-2.c: Remove markers for errors not + output at parsing time. + * gcc.target/i386/sseregparm-8.c: Move here compile time errors + from gcc.target/i386/sseregparm-2.c. + * gcc.dg/weak/weak-6.c: Do not require extra errors we output + confused by earlier errors. + * gcc.dg/weak/weak-7.c: Likewise. + +2008-06-18 Daniel Kraft <d@domob.eu> + + PR fortran/36517, fortran/36492 + * gfortran.dg/array_constructor_25.f03: New test. + * gfortran.dg/array_constructor_26.f03: New test. + * gfortran.dg/array_constructor_27.f03: New test. + * gfortran.dg/array_constructor_28.f03: New test. + * gfortran.dg/array_constructor_29.f03: New test. + * gfortran.dg/array_constructor_30.f03: New test. + * gfortran.dg/array_constructor_type_19.f03: New test. + * gfortran.dg/array_constructor_type_20.f03: New test. + * gfortran.dg/array_constructor_type_21.f03: New test. + +2008-06-17 Daniel Kraft <d@domob.eu> + + PR fortran/36112 + * gfortran.dg/bounds_check_array_ctor_1.f90: New test. + * gfortran.dg/bounds_check_array_ctor_2.f90: New test. + * gfortran.dg/bounds_check_array_ctor_3.f90: New test. + * gfortran.dg/bounds_check_array_ctor_4.f90: New test. + * gfortran.dg/bounds_check_array_ctor_5.f90: New test. + * gfortran.dg/bounds_check_array_ctor_6.f90: New test. + * gfortran.dg/bounds_check_array_ctor_7.f90: New test. + * gfortran.dg/bounds_check_array_ctor_8.f90: New test. + * gfortran.dg/arrayio_0.f90: Fixed invalid array constructor. + * gfortran.dg/char_cons_len.f90: Ditto. + * gfortran.dg/char_initializer_actual.f90: Ditto. + * gfortran.dg/pr15959.f90: Ditto. + * gfortran.dg/transfer_simplify_2.f90: Ditto. + * gfortran.dg/char_length_1.f90: Changed expected error messages. + +2008-06-17 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/36366 + * gfortran.dg/used_types_20.f90: New test. + +2008-06-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/36546 + * gfortran.dg: namelist_49.f90: New test. + +2008-06-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/36544 + * gfortran.dg/fseek.f90: Adjust test conditions for variable newline. + +2008-06-16 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/36493 + * gcc.dg/vect/pr36493.c: New testcase. + +2008-06-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/36515 + * gfortran.dg/no_range_check_2.f90: New test. + +2008-06-15 Mark Shinwell <shinwell@codesourcery.com> + + * lib/target-supports.exp (check_effective_target_mips_loongson): New. + * gcc.target/mips/loongson-simd.c: New. + +2008-06-14 Simon Martin <simartin@users.sourceforge.net> + + PR c++/35320 + * g++.dg/parse/bitfield3.C: New test. + +2008-06-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/36538 + * gfortran.dg: namelist_48.f90: New test. + +2008-06-14 Simon Martin <simartin@users.sourceforge.net> + + PR c++/35317 + * g++.dg/other/dtor2.C: New test. + +2008-06-13 Olivier Hainque <hainque@adacore.com> + + * gnat.dg/task_stack_align.adb: New test. + +2008-06-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/35863 + * gfortran.dg/widechar_IO_1.f90: New test. + * gfortran.dg/widechar_IO_2.f90: New test. + * gfortran.dg/widechar_IO_3.f90: New test. + * gfortran.dg/widechar_IO_4.f90: New test. + 2008-06-13 Tobias Burnus <burnus@net-b.de> PR fortran/36476 diff --git a/gcc/testsuite/g++.dg/other/dtor2.C b/gcc/testsuite/g++.dg/other/dtor2.C new file mode 100644 index 00000000000..459339126eb --- /dev/null +++ b/gcc/testsuite/g++.dg/other/dtor2.C @@ -0,0 +1,7 @@ +/* PR c++/35317 */ +/* { dg-do "compile" } */ + +struct A +{ + void operator delete[] (void*, ...); +}; diff --git a/gcc/testsuite/g++.dg/parse/bitfield3.C b/gcc/testsuite/g++.dg/parse/bitfield3.C new file mode 100644 index 00000000000..d907dcdd19b --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/bitfield3.C @@ -0,0 +1,9 @@ +/* PR c++/35320 */ +/* { dg-do "compile" } */ + +typedef void (func_type)(); + +struct A +{ + friend func_type f : 2; /* { dg-error "with non-integral type" } */ +}; diff --git a/gcc/testsuite/gcc.c-torture/compile/limits-fndefn.c b/gcc/testsuite/gcc.c-torture/compile/limits-fndefn.c index 4d2aef08933..0c5a2f5e774 100644 --- a/gcc/testsuite/gcc.c-torture/compile/limits-fndefn.c +++ b/gcc/testsuite/gcc.c-torture/compile/limits-fndefn.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "too complex for avr" { "avr-*-*" } { "*" } { "" } } */ #define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9, #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) diff --git a/gcc/testsuite/gcc.c-torture/execute/20020619-1.c b/gcc/testsuite/gcc.c-torture/execute/20020619-1.c index 6db1546e867..1a1503e8930 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20020619-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20020619-1.c @@ -1,8 +1,15 @@ -static int ref(void) +#if (__SIZEOF_INT__ == 4) +typedef int int32; +#elif (__SIZEOF_LONG__ == 4) +typedef long int32; +#else +#error Add target support for int32 +#endif +static int32 ref(void) { union { char c[5]; - int i; + int32 i; } u; __builtin_memset (&u, 0, sizeof(u)); @@ -16,7 +23,7 @@ static int ref(void) int main() { - int b = ref(); + int32 b = ref(); if (b != 0x01020304 && b != 0x04030201) abort (); diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x index 937e3c2621d..4535c611eb4 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/20000320-1.x @@ -3,5 +3,8 @@ if {[istarget "m68k-*-*"] && [check_effective_target_coldfire_fpu]} { # not aware of any system that has this. set torture_execute_xfail "m68k-*-*" } - +if [istarget "avr-*-*"] { + # AVR doubles are floats + return 1 +} return 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/pr30704.x b/gcc/testsuite/gcc.c-torture/execute/ieee/pr30704.x new file mode 100644 index 00000000000..1e111fc2c83 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/pr30704.x @@ -0,0 +1,5 @@ +if [istarget "avr-*-*"] {
+ # AVR doubles are floats
+ return 1
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x b/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x index c230c306d29..2664174e05a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x @@ -3,4 +3,8 @@ if { [istarget "d10v-*-*"] && ! [string-match "*-mdouble64*" $CFLAGS] } { set torture_execute_xfail "d10v-*-*" } +if [istarget "avr-*-*"] { + # AVR doubles are floats + return 1 +} return 0 diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.x new file mode 100644 index 00000000000..1e111fc2c83 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.x @@ -0,0 +1,5 @@ +if [istarget "avr-*-*"] {
+ # AVR doubles are floats
+ return 1
+}
+return 0
diff --git a/gcc/testsuite/gcc.dg/Wconversion-5.c b/gcc/testsuite/gcc.dg/Wconversion-5.c index a09caae4def..2b0884525f4 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-5.c +++ b/gcc/testsuite/gcc.dg/Wconversion-5.c @@ -19,7 +19,7 @@ void test1 (void) unsigned char f = (int) uc; signed char g = (int) sc; unsigned char h = (unsigned int) (short int) uc; - signed char i = (int) (unsigned short int) sc; /* { dg-warning "may alter its value" } */ + signed char i = (int) (unsigned short int) sc; /* { dg-warning "may alter its value" "" { xfail avr-*-* } } */ unsigned char j = (unsigned int) (short int) us; /* { dg-warning "may alter its value" } */ signed char k = (int) (unsigned short int) ss; /* { dg-warning "may alter its value" } */ } diff --git a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c index 5911f6a778b..1c03ba487e3 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c +++ b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c @@ -2,6 +2,7 @@ integers. */ /* { dg-do compile } +/* { dg-skip-if "doubles are floats,ints are 16bits" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-std=c99 -Wconversion" } */ #include <limits.h> @@ -70,3 +71,4 @@ void h (void) } + diff --git a/gcc/testsuite/gcc.dg/Wconversion-real.c b/gcc/testsuite/gcc.dg/Wconversion-real.c index 4e79fd20e13..06396fba33c 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-real.c +++ b/gcc/testsuite/gcc.dg/Wconversion-real.c @@ -1,6 +1,7 @@ /* Test for diagnostics for Wconversion for floating-point. */ /* { dg-do compile } */ +/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-std=c99 -Wconversion" } */ float vfloat; diff --git a/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c b/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c index ae13e73ef8b..79fbbd00f44 100644 --- a/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c +++ b/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c @@ -1,8 +1,8 @@ /* Test that -Wtype-limits is enabled by -Wextra */ /* { dg-do compile } */ +/* { dg-excess-errors "short=int" { target { avr-*-* } } } */ /* { dg-options "-Wextra" } */ - void a (unsigned char x) { if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ @@ -22,10 +22,10 @@ void a (unsigned char x) void b (unsigned short x) { - if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ - if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ - if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ - if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ + if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */ + if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */ + if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */ + if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */ } void c (unsigned int x) @@ -64,3 +64,4 @@ int test (int x) return 0; } + diff --git a/gcc/testsuite/gcc.dg/Wtype-limits.c b/gcc/testsuite/gcc.dg/Wtype-limits.c index 64e7da61c9a..5a4605a08d6 100644 --- a/gcc/testsuite/gcc.dg/Wtype-limits.c +++ b/gcc/testsuite/gcc.dg/Wtype-limits.c @@ -1,8 +1,8 @@ /* { dg-do compile } */ +/* { dg-excess-errors "short=int" { target { avr-*-* } } } */ /* { dg-options "-Wtype-limits" } */ - void a (unsigned char x) { if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ @@ -22,10 +22,10 @@ void a (unsigned char x) void b (unsigned short x) { - if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ - if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ - if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ - if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */ + if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */ + if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */ + if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { ! "avr-*-*" } } } */ + if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { ! "avr-*-*" } } } */ } void c (unsigned int x) @@ -64,3 +64,4 @@ int test (int x) return 0; } + diff --git a/gcc/testsuite/gcc.dg/asm-wide-1.c b/gcc/testsuite/gcc.dg/asm-wide-1.c index 5cc6b0784bb..a42271fd4b1 100644 --- a/gcc/testsuite/gcc.dg/asm-wide-1.c +++ b/gcc/testsuite/gcc.dg/asm-wide-1.c @@ -30,6 +30,3 @@ f (void) /* { dg-error "output" "output" { target *-*-* } 16 } */ /* { dg-error "output" "output" { target *-*-* } 18 } */ /* { dg-error "output" "output" { target *-*-* } 20 } */ -/* { dg-warning "match" "match" { target *-*-* } 21 } */ -/* { dg-error "register" "register" { target *-*-* } 23 } */ -/* { dg-error "register" "register" { target *-*-* } 25 } */ diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c index a1ba20fce53..bc49a645809 100644 --- a/gcc/testsuite/gcc.dg/builtin-apply2.c +++ b/gcc/testsuite/gcc.dg/builtin-apply2.c @@ -1,10 +1,12 @@ +/* { dg-do run } */ +/* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "avr-*-*" } { "*" } { "" } } */ + /* PR target/12503 */ /* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */ /* Verify that __builtin_apply behaves correctly on targets with pre-pushed arguments (e.g. SPARC). */ -/* { dg-do run } */ #define INTEGER_ARG 5 diff --git a/gcc/testsuite/gcc.dg/builtin-return-1.c b/gcc/testsuite/gcc.dg/builtin-return-1.c index 75c9acdf72a..68fd0556b3d 100644 --- a/gcc/testsuite/gcc.dg/builtin-return-1.c +++ b/gcc/testsuite/gcc.dg/builtin-return-1.c @@ -1,7 +1,7 @@ /* PR middle-end/11151 */ /* Originator: Andrew Church <gcczilla@achurch.org> */ /* { dg-do run } */ - +/* { dg-xfail-run-if "PR36571 untyped return is char register" { "avr-*-*" } { "*" } { "" } } */ /* This used to fail on SPARC because the (undefined) return value of 'bar' was overwriting that of 'foo'. */ diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h index 556e87adee0..7e375b8d693 100644 --- a/gcc/testsuite/gcc.dg/builtins-config.h +++ b/gcc/testsuite/gcc.dg/builtins-config.h @@ -13,7 +13,7 @@ /* PA HP-UX doesn't have the entire C99 runtime. */ #elif defined(__sgi) /* Irix6 doesn't have the entire C99 runtime. */ -#elif defined(AVR) +#elif defined(__AVR__) /* AVR doesn't have the entire C99 runtime. */ #elif defined(__FreeBSD__) && (__FreeBSD__ < 5) /* FreeBSD before version 5 doesn't have the entire C99 runtime. */ diff --git a/gcc/testsuite/gcc.dg/cdce1.c b/gcc/testsuite/gcc.dg/cdce1.c index 77971720086..61b19c9065c 100644 --- a/gcc/testsuite/gcc.dg/cdce1.c +++ b/gcc/testsuite/gcc.dg/cdce1.c @@ -1,9 +1,9 @@ /* { dg-do run } */ +/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */ /* { 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-final { cleanup-tree-dump "cdce" } } */ - #include <stdlib.h> #include <math.h> #include <errno.h> diff --git a/gcc/testsuite/gcc.dg/cdce2.c b/gcc/testsuite/gcc.dg/cdce2.c index d79f27e404f..a461ce7ac30 100644 --- a/gcc/testsuite/gcc.dg/cdce2.c +++ b/gcc/testsuite/gcc.dg/cdce2.c @@ -1,9 +1,9 @@ /* { dg-do run } */ +/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */ /* { dg-final { scan-tree-dump "cdce2.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/ /* { dg-final { cleanup-tree-dump "cdce" } } */ - #include <stdlib.h> #include <math.h> #include <errno.h> diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c index f7c943ec56c..c53c3e8c2bd 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c +++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c @@ -762,6 +762,7 @@ switchfiles (int fields) exit (1); } fprintf (outfile, "\ +/* { dg-require-effective-target int32plus } */\n\ /* { dg-options \"-I%s\" } */\n\ /* { dg-options \"-I%s -fno-common\" { target hppa*-*-hpux* *-*-darwin* *-*-mingw32* *-*-cygwin* } } */\n\ /* { dg-options \"-I%s -mno-base-addresses\" { target mmix-*-* } } */\n\ diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c index 6dc2a9e720e..7603f751992 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c @@ -1,3 +1,4 @@ +/* { dg-xfail-run-if "" { lax_strtofp } "*" "" } */ /* { dg-options "-std=gnu99 -w" } */ /* This test assumes IEEE float and double. */ diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c index 86ae4303034..90f0692136c 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c @@ -1,3 +1,4 @@ +/* { dg-xfail-run-if "" { lax_strtofp } "*" "" } */ /* { dg-options "-std=gnu99 -w" } */ /* This test assumes IEEE float and double. */ diff --git a/gcc/testsuite/gcc.dg/fold-bitand-1.c b/gcc/testsuite/gcc.dg/fold-bitand-1.c index 413ed67d239..f490b153b2d 100644 --- a/gcc/testsuite/gcc.dg/fold-bitand-1.c +++ b/gcc/testsuite/gcc.dg/fold-bitand-1.c @@ -1,11 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-original" } */ +/* { dg-options "-w -fdump-tree-original" } */ char c1 __attribute__ ((aligned (1))); char c2 __attribute__ ((aligned (2))); char c4 __attribute__ ((aligned (4))); -char c8 __attribute__ ((aligned (8))); - +char c8 __attribute__ ((aligned (8))); unsigned f1(void) { return 3 & (__SIZE_TYPE__)&c1; diff --git a/gcc/testsuite/gcc.dg/fold-eqandshift-3.c b/gcc/testsuite/gcc.dg/fold-eqandshift-3.c index d3b4adcf76c..5ed744ab536 100644 --- a/gcc/testsuite/gcc.dg/fold-eqandshift-3.c +++ b/gcc/testsuite/gcc.dg/fold-eqandshift-3.c @@ -3,14 +3,22 @@ /* { dg-options "-O2 -fdump-tree-original" } */ void foo (void); - +#if(__SIZEOF_INT__ >= 4) int test1 (int a) +#else +int test1 (long a) +#endif + { if ((a >> 3) & 134217728) foo (); } +#if(__SIZEOF_INT__ >= 4) int test2 (unsigned int b) +#else +int test2 (unsigned long b) +#endif { if ((b >> 3) & 134217728) foo (); diff --git a/gcc/testsuite/gcc.dg/fold-overflow-1.c b/gcc/testsuite/gcc.dg/fold-overflow-1.c index bed8aac9f9b..e2b731b735a 100644 --- a/gcc/testsuite/gcc.dg/fold-overflow-1.c +++ b/gcc/testsuite/gcc.dg/fold-overflow-1.c @@ -1,5 +1,5 @@ /* { dg-compile } */ -/* { dg-skip-if "consts are shorts, not longs" { "m32c-*-*" } { "*" } { "" } } */ +/* { dg-skip-if "consts are shorts, not longs" { "m32c-*-*" "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-O -ftrapping-math" } */ /* There should be exactly 2 +Inf in the assembly file. */ diff --git a/gcc/testsuite/gcc.dg/inline-31.c b/gcc/testsuite/gcc.dg/inline-31.c new file mode 100644 index 00000000000..1d9a2212e10 --- /dev/null +++ b/gcc/testsuite/gcc.dg/inline-31.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c99 -pedantic-errors" } */ +inline int f (void) { return 0; } + +void +g (void) +{ + extern int f(); +} diff --git a/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c b/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c index afb4e517f28..da19de508d4 100644 --- a/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c +++ b/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c @@ -5,8 +5,9 @@ short int g (void) { - short int wc = ((short int)1 << 31) - 1; /* { dg-bogus "overflow .* overflow" } */ + short int wc = ((short int)1 << (8 * __SIZEOF_INT__ - 1)) - 1; /* { dg-bogus "overflow .* overflow" } */ /* { dg-warning "overflow" "" { target *-*-* } 8 } */ return wc; } + diff --git a/gcc/testsuite/gcc.dg/pch/struct-1.c b/gcc/testsuite/gcc.dg/pch/struct-1.c index 698e88b285a..9559c07e980 100644 --- a/gcc/testsuite/gcc.dg/pch/struct-1.c +++ b/gcc/testsuite/gcc.dg/pch/struct-1.c @@ -1,4 +1,3 @@ -/* { dg-require-effective-target int32plus } */ #include "struct-1.h" struct ChainSearchRecord { @@ -7,6 +6,11 @@ struct ChainSearchRecord { typedef struct ChainSearchRecord ChainSearchRecord; void foo (ChainSearchPtr s) { +#if(__SIZEOF_INT__ >= 4) s->identity = 0x6a73616d; +#else + s->identity = 0x616d; +#endif } + diff --git a/gcc/testsuite/gcc.dg/pragma-pack-4.c b/gcc/testsuite/gcc.dg/pragma-pack-4.c index 1765591f43c..05a24e5d6a5 100644 --- a/gcc/testsuite/gcc.dg/pragma-pack-4.c +++ b/gcc/testsuite/gcc.dg/pragma-pack-4.c @@ -1,5 +1,7 @@ /* PR c/28286 */ /* { dg-do compile } */ +/* { dg-skip-if "no Pragma pack" { "avr-*-*" } { "*" } { "" } } */ + #pragma pack(0.5) /* { dg-warning "invalid constant" } */ #pragma pack(push,0.5) /* { dg-warning "invalid constant" } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c index ded6ef76469..f8ee97c7213 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c @@ -18,7 +18,8 @@ foo (int attr_kind, unsigned long offset) exit (0); } -/* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */ - +/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */ + /* { dg-final { cleanup-tree-dump "dom3" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c index 8b53d818d27..90359ed8cc7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c @@ -18,7 +18,8 @@ foo (int attr_kind, unsigned long offset) exit (0); } -/* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */ +/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */ /* { dg-final { cleanup-tree-dump "dom3" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c index 7df9f45ab17..987f8a3909a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c @@ -1,13 +1,19 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-forwprop1 -W -Wall" } */ +#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) +typedef int intflt; +#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) +typedef long intflt; +#else +#error Add target support here for type that will union float size +#endif - -int b; +intflt b; void f(void) { float a; a = 1; - b = *(int*)&a; /* { dg-warning "aliasing" } */ + b = *(intflt*)&a; /* { dg-warning "aliasing" } */ } /* We should be able to convert the cast to a VCE in forwprop1, diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c index 748c6e81434..cae91bac4ba 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c @@ -4,7 +4,7 @@ The testcase comes from PR 29256 (and originally, the stream benchmark). */ -/* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-*} } */ +/* { dg-do compile { target { i?86-*-* || { x86_64-*-* || powerpc_hard_double } } } } */ /* { dg-require-effective-target nonpic } */ /* { dg-options "-O3 -fdump-tree-final_cleanup" } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c index ce6ba28d74a..e1bdde24049 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c @@ -59,6 +59,7 @@ void test4(struct a *A, unsigned long b) A[b+1].Y += i; } } - -/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim" } } */ +/* long index not hoisted for avr target PR 36561 */ +/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim" { xfail { "avr-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim" { target { "avr-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "lim" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c index 6721155fc9a..d20b1022f0b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c @@ -35,5 +35,7 @@ can_combine_p (rtx insn, rtx elt) return 0; } -/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" } } */ +/* Target with fno-delete-null-pointer-checks should not fold checks */ +/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp2" { target { keeps_null_pointer_checks } } } } */ /* { dg-final { cleanup-tree-dump "vrp2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c index 0e1b4e6d3be..ce62fa3f0f9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c @@ -25,5 +25,7 @@ foo (int *p, int b) return a; } -/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */ +/* Target with fno-delete-null-pointer-checks should not fold checks */ +/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */ /* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c index ffaccefe94c..2409608d9da 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c @@ -15,6 +15,9 @@ foo (int *p) return 0; } -/* { dg-final { scan-tree-dump-times "Folding predicate " 1 "vrp1" } } */ -/* { dg-final { scan-tree-dump-not "b_. =" "vrp1" } } */ +/* Target with fno-delete-null-pointer-checks should not fold checks */ +/* { dg-final { scan-tree-dump-times "Folding predicate " 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate " 0 "vrp1" { target { keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-not "b_. =" "vrp1" { target { ! avr-*-* } } } } */ +/* { dg-final { scan-tree-dump "b_. =" "vrp1" { target { avr-*-* } } } } */ /* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c b/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c index 1cece8163d2..55e75d48e2b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c @@ -29,7 +29,7 @@ void init_code () object V658; T1240: - if (V648 >= (long)V651) +if (V648 >= (long)V651) /* { dg-warning "cast from pointer to integer of different size" "" { target { "avr-*-*" } } } */ goto T1243; V653 = ((char *) V654->v.v_self)[V648]; V659 = (object) V654 + V653; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c index a66adeb8c99..bd81831eba8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c @@ -1,16 +1,23 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-fre-details -fdump-tree-optimized" } */ +#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) +typedef int intflt; +#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) +typedef long intflt; +#else +#error Add target support here for type that will union float size +#endif struct X { int i; union { - int j; - int k; + intflt j; + intflt k; float f; } u; }; -int foo(int j) +intflt foo(intflt j) { struct X a; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c index 84a9aeb60ee..6e17bd531b3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c @@ -1,11 +1,17 @@ /* { dg-do compile } */ /* { dg-options "-O -fdump-tree-fre-details" } */ - +#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) +typedef int intflt; +#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) +typedef long intflt; +#else +#error Add target support here for type that will union float size +#endif union U { - int i; + intflt i; float f; }; -int foo(int i, int b) +intflt foo(int i, int b) { union U u; if (b) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c index d5cd775aaaf..56fca97116c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c @@ -19,6 +19,7 @@ foo (struct A *p, struct A *q) if (p) return x + p->b; } - -/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */ +/* Target with fno-delete-null-pointer-checks should not fold check */ +/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */ /* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c index 1bff5712bca..6584919b560 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c @@ -29,8 +29,11 @@ foo (int i, int *p) return i; } - +/* Target with fno-delete-null-pointer-checks should not fold checks */ /* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */ -/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" } } */ -/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */ + +/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 1 "vrp1" { target { keeps_null_pointer_checks } } } } */ /* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c index 5268e181c2c..193199fbf70 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c @@ -17,7 +17,8 @@ foo (int a, int *p) return a; } - -/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */ -/* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" } } */ +/* Target with fno-delete-null-pointer-checks should not fold checks */ +/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */ /* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/ucnid-5.c b/gcc/testsuite/gcc.dg/ucnid-5.c index 8cd86060dfe..aea57ef0682 100644 --- a/gcc/testsuite/gcc.dg/ucnid-5.c +++ b/gcc/testsuite/gcc.dg/ucnid-5.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */ +/* { dg-skip-if "No dollar in identfiers" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-std=c99 -fdollars-in-identifiers -fextended-identifiers" } */ void abort (void); diff --git a/gcc/testsuite/gcc.dg/utf-cvt.c b/gcc/testsuite/gcc.dg/utf-cvt.c index 109d231bff4..5c39644f917 100644 --- a/gcc/testsuite/gcc.dg/utf-cvt.c +++ b/gcc/testsuite/gcc.dg/utf-cvt.c @@ -1,6 +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-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */ typedef short unsigned int char16_t; @@ -43,9 +44,9 @@ void m (char16_t c0, char32_t c1) f_c (c1); /* { dg-warning "alter its value" } */ fsc (c1); /* { dg-warning "alter its value" } */ fuc (c1); /* { dg-warning "alter its value" } */ - f_s (c1); /* { dg-warning "alter its value" } */ - fss (c1); /* { dg-warning "alter its value" } */ - fus (c1); /* { dg-warning "alter its value" } */ + f_s (c1); /* { dg-warning "alter its value" "" { target { ! "avr-*-*" } } } */ + fss (c1); /* { dg-warning "alter its value" "" { target { ! "avr-*-*" } } } */ + fus (c1); /* { dg-warning "alter its value" "" { target { ! "avr-*-*" } } } */ f_i (c1); /* { dg-warning "change the sign" } */ fsi (c1); /* { dg-warning "change the sign" } */ fui (c1); diff --git a/gcc/testsuite/gcc.dg/utf32-1.c b/gcc/testsuite/gcc.dg/utf32-1.c index 1807d57f6ab..300fd462f26 100644 --- a/gcc/testsuite/gcc.dg/utf32-1.c +++ b/gcc/testsuite/gcc.dg/utf32-1.c @@ -1,6 +1,7 @@ /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */ /* Test the support for char32_t character constants. */ /* { dg-do run } */ +/* { dg-xfail-run-if "PR36470" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-std=gnu99 -Wall -Werror" } */ typedef unsigned int char32_t; diff --git a/gcc/testsuite/gcc.dg/utf32-2.c b/gcc/testsuite/gcc.dg/utf32-2.c index 820eb8c41ae..0c2853715a0 100644 --- a/gcc/testsuite/gcc.dg/utf32-2.c +++ b/gcc/testsuite/gcc.dg/utf32-2.c @@ -1,6 +1,7 @@ /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */ /* Test the support for char32_t* string constants. */ /* { dg-do run } */ +/* { dg-xfail-run-if "PR36470" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-std=gnu99 -Wall -Werror" } */ typedef unsigned int char32_t; diff --git a/gcc/testsuite/gcc.dg/utf32-3.c b/gcc/testsuite/gcc.dg/utf32-3.c index 20cbc78e5f5..49991d08825 100644 --- a/gcc/testsuite/gcc.dg/utf32-3.c +++ b/gcc/testsuite/gcc.dg/utf32-3.c @@ -1,6 +1,7 @@ /* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */ /* Test concatenation of char32_t* string literals. */ /* { dg-do run } */ +/* { dg-xfail-run-if "PR36470" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-std=gnu99 -Wall -Werror" } */ typedef unsigned int char32_t; diff --git a/gcc/testsuite/gcc.dg/vect/pr36493.c b/gcc/testsuite/gcc.dg/vect/pr36493.c new file mode 100644 index 00000000000..d96e96221d4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr36493.c @@ -0,0 +1,23 @@ +/* { dg-require-effective-target vect_int } */ + +#include "tree-vect.h" + +int +main (void) +{ + int i; + long x[12] __attribute__((aligned(16))); + + x[0] = 1; + for (i = 0; i < 12; i++) + x[i] = i; + + if (x[0] != 0) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/weak/weak-2.c b/gcc/testsuite/gcc.dg/weak/weak-2.c index 7f9cde5d095..973f4c216b6 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-2.c +++ b/gcc/testsuite/gcc.dg/weak/weak-2.c @@ -24,7 +24,7 @@ void * foo1b (void) return (void *)ffoo1b; } -extern void * ffoo1c (void); /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */ +extern void * ffoo1c (void); void * foo1c (void) { return (void *)ffoo1c; diff --git a/gcc/testsuite/gcc.dg/weak/weak-3.c b/gcc/testsuite/gcc.dg/weak/weak-3.c index 21e5fa09c28..748bd236cc5 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-3.c +++ b/gcc/testsuite/gcc.dg/weak/weak-3.c @@ -34,7 +34,7 @@ void * foo1c (void) { return (void *)ffoo1c; } -extern void * ffoo1c (void) __attribute__((weak)); /* { dg-warning "weak declaration" "weak declaration" } */ +extern void * ffoo1c (void) __attribute__((weak)); int ffoo1d (void); @@ -59,7 +59,7 @@ void * foo1f (void) return 0; } void * ffoox1f (void) { return (void *)0; } -extern void * ffoo1f (void) __attribute__((weak, alias ("ffoox1f"))); /* { dg-warning "weak declaration" "weak declaration" } */ +extern void * ffoo1f (void) __attribute__((weak, alias ("ffoox1f"))); extern void * ffoo1g (void); diff --git a/gcc/testsuite/gcc.dg/weak/weak-4.c b/gcc/testsuite/gcc.dg/weak/weak-4.c index 622a1c6675e..cd8a1e9124d 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-4.c +++ b/gcc/testsuite/gcc.dg/weak/weak-4.c @@ -32,7 +32,7 @@ void * foo1b (void) } -extern int vfoo1c; /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */ +extern int vfoo1c; void * foo1c (void) { return (void *)&vfoo1c; @@ -64,7 +64,7 @@ void * foo1f (void) #pragma weak vfoo1f -extern int vfoo1g; /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */ +extern int vfoo1g; void * foo1g (void) { return (void *)&vfoo1g; diff --git a/gcc/testsuite/gcc.dg/weak/weak-5.c b/gcc/testsuite/gcc.dg/weak/weak-5.c index a8aca287544..e82792af3ff 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-5.c +++ b/gcc/testsuite/gcc.dg/weak/weak-5.c @@ -39,7 +39,7 @@ void * foo1c (void) { return (void *)&vfoo1c; } -extern int vfoo1c __attribute__((weak)); /* { dg-warning "unspecified behavior" } */ +extern int vfoo1c __attribute__((weak)); extern int vfoo1d __attribute__((weak)); @@ -63,7 +63,7 @@ void * foo1f (void) { return (void *)&vfoo1f; } -extern int vfoo1f __attribute__((weak)); /* { dg-warning "unspecified behavior" } */ +extern int vfoo1f __attribute__((weak)); extern int vfoo1g; @@ -71,7 +71,7 @@ void * foo1g (void) { return (void *)&vfoo1g; } -int vfoo1g __attribute__((weak)); /* { dg-warning "unspecified behavior" } */ +int vfoo1g __attribute__((weak)); extern int vfoo1h __attribute__((weak)); diff --git a/gcc/testsuite/gcc.dg/weak/weak-6.c b/gcc/testsuite/gcc.dg/weak/weak-6.c index 711003ccd03..6fa0d66ff2d 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-6.c +++ b/gcc/testsuite/gcc.dg/weak/weak-6.c @@ -2,6 +2,6 @@ /* { dg-require-weak "" } */ extern void * foo (void); -void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */ +void * foo (void) { return (void *)foo; } /* { dg-error "function pointer" "pointer conversion" { target *-*-* } 5 } */ #pragma weak foo diff --git a/gcc/testsuite/gcc.dg/weak/weak-7.c b/gcc/testsuite/gcc.dg/weak/weak-7.c index 7c4a4dc7c25..07c03bc975a 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-7.c +++ b/gcc/testsuite/gcc.dg/weak/weak-7.c @@ -2,6 +2,6 @@ /* { dg-require-weak "" } */ extern void * foo (void); -void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */ +void * foo (void) { return (void *)foo; } /* { dg-error "function pointer" "pointer conversion" { target *-*-* } 5 } */ extern void * foo (void) __attribute__((weak)); diff --git a/gcc/testsuite/gcc.dg/wtr-conversion-1.c b/gcc/testsuite/gcc.dg/wtr-conversion-1.c index 15086f245fe..72094c21840 100644 --- a/gcc/testsuite/gcc.dg/wtr-conversion-1.c +++ b/gcc/testsuite/gcc.dg/wtr-conversion-1.c @@ -28,9 +28,9 @@ testfunc1 () foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */ foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */ - foo_ld (f); - foo_ld (ld); - foo_ld (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */ + foo_ld (f); /* { dg-warning "as 'float' rather than 'double'" "small double" { target { "avr-*-*" } } } */ + foo_ld (ld);/* { dg-warning "as 'float' rather than 'double'" "small long double" { target { "avr-*-*" } } } */ + foo_ld (cd);/* { dg-warning "as floating rather than complex" "prototype conversion warning" } */ foo_cd (i); /* { dg-warning "as complex rather than integer" "prototype conversion warning" } */ foo_cd (f); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */ diff --git a/gcc/testsuite/gcc.target/i386/sseregparm-2.c b/gcc/testsuite/gcc.target/i386/sseregparm-2.c index 84bf58925c7..cca98ca82ba 100644 --- a/gcc/testsuite/gcc.target/i386/sseregparm-2.c +++ b/gcc/testsuite/gcc.target/i386/sseregparm-2.c @@ -10,8 +10,8 @@ extern double d; extern float f; void test(void) { - f = essef(f); /* { dg-error "SSE" } */ - d = essed(d); /* { dg-error "SSE" } */ - f = ssef(f); /* { dg-error "SSE" } */ - d = ssed(d); /* { dg-error "SSE" } */ + f = essef(f); + d = essed(d); + f = ssef(f); + d = ssed(d); } diff --git a/gcc/testsuite/gcc.target/i386/sseregparm-8.c b/gcc/testsuite/gcc.target/i386/sseregparm-8.c new file mode 100644 index 00000000000..3a9d345a96b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sseregparm-8.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-mno-sse" } */ +/* { dg-require-effective-target ilp32 } */ + +float essef(float) __attribute__((sseregparm)); +double essed(double) __attribute__((sseregparm)); +float __attribute__((sseregparm)) ssef(float f); +double __attribute__((sseregparm)) ssed(double d); +extern double d; +extern float f; +void test(void) +{ + f = essef(f); /* { dg-error "SSE" } */ + d = essed(d); /* { dg-error "SSE" } */ + f = ssef(f); /* { dg-error "SSE" } */ + d = ssed(d); /* { dg-error "SSE" } */ +} diff --git a/gcc/testsuite/gcc.target/mips/loongson-simd.c b/gcc/testsuite/gcc.target/mips/loongson-simd.c new file mode 100644 index 00000000000..e4cae5ea61d --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/loongson-simd.c @@ -0,0 +1,1963 @@ +/* Test cases for ST Microelectronics Loongson-2E/2F SIMD intrinsics. + Copyright (C) 2008 Free Software Foundation, Inc. + Contributed by CodeSourcery. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +/* { dg-do run } */ +/* { dg-require-effective-target mips_loongson } */ + +#include "loongson.h" +#include <stdio.h> +#include <stdint.h> +#include <assert.h> +#include <limits.h> + +typedef union { int32x2_t v; int32_t a[2]; } int32x2_encap_t; +typedef union { int16x4_t v; int16_t a[4]; } int16x4_encap_t; +typedef union { int8x8_t v; int8_t a[8]; } int8x8_encap_t; +typedef union { uint32x2_t v; uint32_t a[2]; } uint32x2_encap_t; +typedef union { uint16x4_t v; uint16_t a[4]; } uint16x4_encap_t; +typedef union { uint8x8_t v; uint8_t a[8]; } uint8x8_encap_t; + +#define UINT16x4_MAX USHRT_MAX +#define UINT8x8_MAX UCHAR_MAX +#define INT8x8_MAX SCHAR_MAX +#define INT16x4_MAX SHRT_MAX +#define INT32x2_MAX INT_MAX + +static void test_packsswh (void) +{ + int32x2_encap_t s, t; + int16x4_encap_t r; + s.a[0] = INT16x4_MAX - 2; + s.a[1] = INT16x4_MAX - 1; + t.a[0] = INT16x4_MAX; + t.a[1] = INT16x4_MAX + 1; + r.v = packsswh (s.v, t.v); + assert (r.a[0] == INT16x4_MAX - 2); + assert (r.a[1] == INT16x4_MAX - 1); + assert (r.a[2] == INT16x4_MAX); + assert (r.a[3] == INT16x4_MAX); +} + +static void test_packsshb (void) +{ + int16x4_encap_t s, t; + int8x8_encap_t r; + s.a[0] = INT8x8_MAX - 6; + s.a[1] = INT8x8_MAX - 5; + s.a[2] = INT8x8_MAX - 4; + s.a[3] = INT8x8_MAX - 3; + t.a[0] = INT8x8_MAX - 2; + t.a[1] = INT8x8_MAX - 1; + t.a[2] = INT8x8_MAX; + t.a[3] = INT8x8_MAX + 1; + r.v = packsshb (s.v, t.v); + assert (r.a[0] == INT8x8_MAX - 6); + assert (r.a[1] == INT8x8_MAX - 5); + assert (r.a[2] == INT8x8_MAX - 4); + assert (r.a[3] == INT8x8_MAX - 3); + assert (r.a[4] == INT8x8_MAX - 2); + assert (r.a[5] == INT8x8_MAX - 1); + assert (r.a[6] == INT8x8_MAX); + assert (r.a[7] == INT8x8_MAX); +} + +static void test_packushb (void) +{ + uint16x4_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = UINT8x8_MAX - 6; + s.a[1] = UINT8x8_MAX - 5; + s.a[2] = UINT8x8_MAX - 4; + s.a[3] = UINT8x8_MAX - 3; + t.a[0] = UINT8x8_MAX - 2; + t.a[1] = UINT8x8_MAX - 1; + t.a[2] = UINT8x8_MAX; + t.a[3] = UINT8x8_MAX + 1; + r.v = packushb (s.v, t.v); + assert (r.a[0] == UINT8x8_MAX - 6); + assert (r.a[1] == UINT8x8_MAX - 5); + assert (r.a[2] == UINT8x8_MAX - 4); + assert (r.a[3] == UINT8x8_MAX - 3); + assert (r.a[4] == UINT8x8_MAX - 2); + assert (r.a[5] == UINT8x8_MAX - 1); + assert (r.a[6] == UINT8x8_MAX); + assert (r.a[7] == UINT8x8_MAX); +} + +static void test_paddw_u (void) +{ + uint32x2_encap_t s, t; + uint32x2_encap_t r; + s.a[0] = 1; + s.a[1] = 2; + t.a[0] = 3; + t.a[1] = 4; + r.v = paddw_u (s.v, t.v); + assert (r.a[0] == 4); + assert (r.a[1] == 6); +} + +static void test_paddw_s (void) +{ + int32x2_encap_t s, t; + int32x2_encap_t r; + s.a[0] = -2; + s.a[1] = -1; + t.a[0] = 3; + t.a[1] = 4; + r.v = paddw_s (s.v, t.v); + assert (r.a[0] == 1); + assert (r.a[1] == 3); +} + +static void test_paddh_u (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 1; + s.a[1] = 2; + s.a[2] = 3; + s.a[3] = 4; + t.a[0] = 5; + t.a[1] = 6; + t.a[2] = 7; + t.a[3] = 8; + r.v = paddh_u (s.v, t.v); + assert (r.a[0] == 6); + assert (r.a[1] == 8); + assert (r.a[2] == 10); + assert (r.a[3] == 12); +} + +static void test_paddh_s (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -10; + s.a[1] = -20; + s.a[2] = -30; + s.a[3] = -40; + t.a[0] = 1; + t.a[1] = 2; + t.a[2] = 3; + t.a[3] = 4; + r.v = paddh_s (s.v, t.v); + assert (r.a[0] == -9); + assert (r.a[1] == -18); + assert (r.a[2] == -27); + assert (r.a[3] == -36); +} + +static void test_paddb_u (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 1; + s.a[1] = 2; + s.a[2] = 3; + s.a[3] = 4; + s.a[4] = 5; + s.a[5] = 6; + s.a[6] = 7; + s.a[7] = 8; + t.a[0] = 9; + t.a[1] = 10; + t.a[2] = 11; + t.a[3] = 12; + t.a[4] = 13; + t.a[5] = 14; + t.a[6] = 15; + t.a[7] = 16; + r.v = paddb_u (s.v, t.v); + assert (r.a[0] == 10); + assert (r.a[1] == 12); + assert (r.a[2] == 14); + assert (r.a[3] == 16); + assert (r.a[4] == 18); + assert (r.a[5] == 20); + assert (r.a[6] == 22); + assert (r.a[7] == 24); +} + +static void test_paddb_s (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -10; + s.a[1] = -20; + s.a[2] = -30; + s.a[3] = -40; + s.a[4] = -50; + s.a[5] = -60; + s.a[6] = -70; + s.a[7] = -80; + t.a[0] = 1; + t.a[1] = 2; + t.a[2] = 3; + t.a[3] = 4; + t.a[4] = 5; + t.a[5] = 6; + t.a[6] = 7; + t.a[7] = 8; + r.v = paddb_s (s.v, t.v); + assert (r.a[0] == -9); + assert (r.a[1] == -18); + assert (r.a[2] == -27); + assert (r.a[3] == -36); + assert (r.a[4] == -45); + assert (r.a[5] == -54); + assert (r.a[6] == -63); + assert (r.a[7] == -72); +} + +static void test_paddd_u (void) +{ + uint64_t d = 123456; + uint64_t e = 789012; + uint64_t r; + r = paddd_u (d, e); + assert (r == 912468); +} + +static void test_paddd_s (void) +{ + int64_t d = 123456; + int64_t e = -789012; + int64_t r; + r = paddd_s (d, e); + assert (r == -665556); +} + +static void test_paddsh (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -1; + s.a[1] = 0; + s.a[2] = 1; + s.a[3] = 2; + t.a[0] = INT16x4_MAX; + t.a[1] = INT16x4_MAX; + t.a[2] = INT16x4_MAX; + t.a[3] = INT16x4_MAX; + r.v = paddsh (s.v, t.v); + assert (r.a[0] == INT16x4_MAX - 1); + assert (r.a[1] == INT16x4_MAX); + assert (r.a[2] == INT16x4_MAX); + assert (r.a[3] == INT16x4_MAX); +} + +static void test_paddsb (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -6; + s.a[1] = -5; + s.a[2] = -4; + s.a[3] = -3; + s.a[4] = -2; + s.a[5] = -1; + s.a[6] = 0; + s.a[7] = 1; + t.a[0] = INT8x8_MAX; + t.a[1] = INT8x8_MAX; + t.a[2] = INT8x8_MAX; + t.a[3] = INT8x8_MAX; + t.a[4] = INT8x8_MAX; + t.a[5] = INT8x8_MAX; + t.a[6] = INT8x8_MAX; + t.a[7] = INT8x8_MAX; + r.v = paddsb (s.v, t.v); + assert (r.a[0] == INT8x8_MAX - 6); + assert (r.a[1] == INT8x8_MAX - 5); + assert (r.a[2] == INT8x8_MAX - 4); + assert (r.a[3] == INT8x8_MAX - 3); + assert (r.a[4] == INT8x8_MAX - 2); + assert (r.a[5] == INT8x8_MAX - 1); + assert (r.a[6] == INT8x8_MAX); + assert (r.a[7] == INT8x8_MAX); +} + +static void test_paddush (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 0; + s.a[1] = 1; + s.a[2] = 0; + s.a[3] = 1; + t.a[0] = UINT16x4_MAX; + t.a[1] = UINT16x4_MAX; + t.a[2] = UINT16x4_MAX; + t.a[3] = UINT16x4_MAX; + r.v = paddush (s.v, t.v); + assert (r.a[0] == UINT16x4_MAX); + assert (r.a[1] == UINT16x4_MAX); + assert (r.a[2] == UINT16x4_MAX); + assert (r.a[3] == UINT16x4_MAX); +} + +static void test_paddusb (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 0; + s.a[1] = 1; + s.a[2] = 0; + s.a[3] = 1; + s.a[4] = 0; + s.a[5] = 1; + s.a[6] = 0; + s.a[7] = 1; + t.a[0] = UINT8x8_MAX; + t.a[1] = UINT8x8_MAX; + t.a[2] = UINT8x8_MAX; + t.a[3] = UINT8x8_MAX; + t.a[4] = UINT8x8_MAX; + t.a[5] = UINT8x8_MAX; + t.a[6] = UINT8x8_MAX; + t.a[7] = UINT8x8_MAX; + r.v = paddusb (s.v, t.v); + assert (r.a[0] == UINT8x8_MAX); + assert (r.a[1] == UINT8x8_MAX); + assert (r.a[2] == UINT8x8_MAX); + assert (r.a[3] == UINT8x8_MAX); + assert (r.a[4] == UINT8x8_MAX); + assert (r.a[5] == UINT8x8_MAX); + assert (r.a[6] == UINT8x8_MAX); + assert (r.a[7] == UINT8x8_MAX); +} + +static void test_pandn_ud (void) +{ + uint64_t d1 = 0x0000ffff0000ffffull; + uint64_t d2 = 0x0000ffff0000ffffull; + uint64_t r; + r = pandn_ud (d1, d2); + assert (r == 0); +} + +static void test_pandn_sd (void) +{ + int64_t d1 = (int64_t) 0x0000000000000000ull; + int64_t d2 = (int64_t) 0xfffffffffffffffeull; + int64_t r; + r = pandn_sd (d1, d2); + assert (r == -2); +} + +static void test_pandn_uw (void) +{ + uint32x2_encap_t s, t; + uint32x2_encap_t r; + s.a[0] = 0xffffffff; + s.a[1] = 0x00000000; + t.a[0] = 0x00000000; + t.a[1] = 0xffffffff; + r.v = pandn_uw (s.v, t.v); + assert (r.a[0] == 0x00000000); + assert (r.a[1] == 0xffffffff); +} + +static void test_pandn_sw (void) +{ + int32x2_encap_t s, t; + int32x2_encap_t r; + s.a[0] = 0xffffffff; + s.a[1] = 0x00000000; + t.a[0] = 0xffffffff; + t.a[1] = 0xfffffffe; + r.v = pandn_sw (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == -2); +} + +static void test_pandn_uh (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 0xffff; + s.a[1] = 0x0000; + s.a[2] = 0xffff; + s.a[3] = 0x0000; + t.a[0] = 0x0000; + t.a[1] = 0xffff; + t.a[2] = 0x0000; + t.a[3] = 0xffff; + r.v = pandn_uh (s.v, t.v); + assert (r.a[0] == 0x0000); + assert (r.a[1] == 0xffff); + assert (r.a[2] == 0x0000); + assert (r.a[3] == 0xffff); +} + +static void test_pandn_sh (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = 0xffff; + s.a[1] = 0x0000; + s.a[2] = 0xffff; + s.a[3] = 0x0000; + t.a[0] = 0xffff; + t.a[1] = 0xfffe; + t.a[2] = 0xffff; + t.a[3] = 0xfffe; + r.v = pandn_sh (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == -2); + assert (r.a[2] == 0); + assert (r.a[3] == -2); +} + +static void test_pandn_ub (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 0xff; + s.a[1] = 0x00; + s.a[2] = 0xff; + s.a[3] = 0x00; + s.a[4] = 0xff; + s.a[5] = 0x00; + s.a[6] = 0xff; + s.a[7] = 0x00; + t.a[0] = 0x00; + t.a[1] = 0xff; + t.a[2] = 0x00; + t.a[3] = 0xff; + t.a[4] = 0x00; + t.a[5] = 0xff; + t.a[6] = 0x00; + t.a[7] = 0xff; + r.v = pandn_ub (s.v, t.v); + assert (r.a[0] == 0x00); + assert (r.a[1] == 0xff); + assert (r.a[2] == 0x00); + assert (r.a[3] == 0xff); + assert (r.a[4] == 0x00); + assert (r.a[5] == 0xff); + assert (r.a[6] == 0x00); + assert (r.a[7] == 0xff); +} + +static void test_pandn_sb (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = 0xff; + s.a[1] = 0x00; + s.a[2] = 0xff; + s.a[3] = 0x00; + s.a[4] = 0xff; + s.a[5] = 0x00; + s.a[6] = 0xff; + s.a[7] = 0x00; + t.a[0] = 0xff; + t.a[1] = 0xfe; + t.a[2] = 0xff; + t.a[3] = 0xfe; + t.a[4] = 0xff; + t.a[5] = 0xfe; + t.a[6] = 0xff; + t.a[7] = 0xfe; + r.v = pandn_sb (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == -2); + assert (r.a[2] == 0); + assert (r.a[3] == -2); + assert (r.a[4] == 0); + assert (r.a[5] == -2); + assert (r.a[6] == 0); + assert (r.a[7] == -2); +} + +static void test_pavgh (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 1; + s.a[1] = 2; + s.a[2] = 3; + s.a[3] = 4; + t.a[0] = 5; + t.a[1] = 6; + t.a[2] = 7; + t.a[3] = 8; + r.v = pavgh (s.v, t.v); + assert (r.a[0] == 3); + assert (r.a[1] == 4); + assert (r.a[2] == 5); + assert (r.a[3] == 6); +} + +static void test_pavgb (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 1; + s.a[1] = 2; + s.a[2] = 3; + s.a[3] = 4; + s.a[4] = 1; + s.a[5] = 2; + s.a[6] = 3; + s.a[7] = 4; + t.a[0] = 5; + t.a[1] = 6; + t.a[2] = 7; + t.a[3] = 8; + t.a[4] = 5; + t.a[5] = 6; + t.a[6] = 7; + t.a[7] = 8; + r.v = pavgb (s.v, t.v); + assert (r.a[0] == 3); + assert (r.a[1] == 4); + assert (r.a[2] == 5); + assert (r.a[3] == 6); + assert (r.a[4] == 3); + assert (r.a[5] == 4); + assert (r.a[6] == 5); + assert (r.a[7] == 6); +} + +static void test_pcmpeqw_u (void) +{ + uint32x2_encap_t s, t; + uint32x2_encap_t r; + s.a[0] = 42; + s.a[1] = 43; + t.a[0] = 43; + t.a[1] = 43; + r.v = pcmpeqw_u (s.v, t.v); + assert (r.a[0] == 0x00000000); + assert (r.a[1] == 0xffffffff); +} + +static void test_pcmpeqh_u (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 42; + s.a[1] = 43; + s.a[2] = 42; + s.a[3] = 43; + t.a[0] = 43; + t.a[1] = 43; + t.a[2] = 43; + t.a[3] = 43; + r.v = pcmpeqh_u (s.v, t.v); + assert (r.a[0] == 0x0000); + assert (r.a[1] == 0xffff); + assert (r.a[2] == 0x0000); + assert (r.a[3] == 0xffff); +} + +static void test_pcmpeqb_u (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 42; + s.a[1] = 43; + s.a[2] = 42; + s.a[3] = 43; + s.a[4] = 42; + s.a[5] = 43; + s.a[6] = 42; + s.a[7] = 43; + t.a[0] = 43; + t.a[1] = 43; + t.a[2] = 43; + t.a[3] = 43; + t.a[4] = 43; + t.a[5] = 43; + t.a[6] = 43; + t.a[7] = 43; + r.v = pcmpeqb_u (s.v, t.v); + assert (r.a[0] == 0x00); + assert (r.a[1] == 0xff); + assert (r.a[2] == 0x00); + assert (r.a[3] == 0xff); + assert (r.a[4] == 0x00); + assert (r.a[5] == 0xff); + assert (r.a[6] == 0x00); + assert (r.a[7] == 0xff); +} + +static void test_pcmpeqw_s (void) +{ + int32x2_encap_t s, t; + int32x2_encap_t r; + s.a[0] = -42; + s.a[1] = -42; + t.a[0] = 42; + t.a[1] = -42; + r.v = pcmpeqw_s (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == -1); +} + +static void test_pcmpeqh_s (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -42; + s.a[1] = -42; + s.a[2] = -42; + s.a[3] = -42; + t.a[0] = 42; + t.a[1] = -42; + t.a[2] = 42; + t.a[3] = -42; + r.v = pcmpeqh_s (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == -1); + assert (r.a[2] == 0); + assert (r.a[3] == -1); +} + +static void test_pcmpeqb_s (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -42; + s.a[1] = -42; + s.a[2] = -42; + s.a[3] = -42; + s.a[4] = -42; + s.a[5] = -42; + s.a[6] = -42; + s.a[7] = -42; + t.a[0] = 42; + t.a[1] = -42; + t.a[2] = 42; + t.a[3] = -42; + t.a[4] = 42; + t.a[5] = -42; + t.a[6] = 42; + t.a[7] = -42; + r.v = pcmpeqb_s (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == -1); + assert (r.a[2] == 0); + assert (r.a[3] == -1); + assert (r.a[4] == 0); + assert (r.a[5] == -1); + assert (r.a[6] == 0); + assert (r.a[7] == -1); +} + +static void test_pcmpgtw_u (void) +{ + uint32x2_encap_t s, t; + uint32x2_encap_t r; + s.a[0] = 42; + s.a[1] = 43; + t.a[0] = 43; + t.a[1] = 42; + r.v = pcmpgtw_u (s.v, t.v); + assert (r.a[0] == 0x00000000); + assert (r.a[1] == 0xffffffff); +} + +static void test_pcmpgth_u (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 40; + s.a[1] = 41; + s.a[2] = 42; + s.a[3] = 43; + t.a[0] = 40; + t.a[1] = 41; + t.a[2] = 43; + t.a[3] = 42; + r.v = pcmpgth_u (s.v, t.v); + assert (r.a[0] == 0x0000); + assert (r.a[1] == 0x0000); + assert (r.a[2] == 0x0000); + assert (r.a[3] == 0xffff); +} + +static void test_pcmpgtb_u (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 40; + s.a[1] = 41; + s.a[2] = 42; + s.a[3] = 43; + s.a[4] = 44; + s.a[5] = 45; + s.a[6] = 46; + s.a[7] = 47; + t.a[0] = 48; + t.a[1] = 47; + t.a[2] = 46; + t.a[3] = 45; + t.a[4] = 44; + t.a[5] = 43; + t.a[6] = 42; + t.a[7] = 41; + r.v = pcmpgtb_u (s.v, t.v); + assert (r.a[0] == 0x00); + assert (r.a[1] == 0x00); + assert (r.a[2] == 0x00); + assert (r.a[3] == 0x00); + assert (r.a[4] == 0x00); + assert (r.a[5] == 0xff); + assert (r.a[6] == 0xff); + assert (r.a[7] == 0xff); +} + +static void test_pcmpgtw_s (void) +{ + int32x2_encap_t s, t; + int32x2_encap_t r; + s.a[0] = 42; + s.a[1] = -42; + t.a[0] = -42; + t.a[1] = -42; + r.v = pcmpgtw_s (s.v, t.v); + assert (r.a[0] == -1); + assert (r.a[1] == 0); +} + +static void test_pcmpgth_s (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -42; + s.a[1] = -42; + s.a[2] = -42; + s.a[3] = -42; + t.a[0] = 42; + t.a[1] = 43; + t.a[2] = 44; + t.a[3] = -43; + r.v = pcmpgth_s (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == -1); +} + +static void test_pcmpgtb_s (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -42; + s.a[1] = -42; + s.a[2] = -42; + s.a[3] = -42; + s.a[4] = 42; + s.a[5] = 42; + s.a[6] = 42; + s.a[7] = 42; + t.a[0] = -45; + t.a[1] = -44; + t.a[2] = -43; + t.a[3] = -42; + t.a[4] = 42; + t.a[5] = 43; + t.a[6] = 41; + t.a[7] = 40; + r.v = pcmpgtb_s (s.v, t.v); + assert (r.a[0] == -1); + assert (r.a[1] == -1); + assert (r.a[2] == -1); + assert (r.a[3] == 0); + assert (r.a[4] == 0); + assert (r.a[5] == 0); + assert (r.a[6] == -1); + assert (r.a[7] == -1); +} + +static void test_pextrh_u (void) +{ + uint16x4_encap_t s; + uint16x4_encap_t r; + s.a[0] = 40; + s.a[1] = 41; + s.a[2] = 42; + s.a[3] = 43; + r.v = pextrh_u (s.v, 1); + assert (r.a[0] == 41); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); +} + +static void test_pextrh_s (void) +{ + int16x4_encap_t s; + int16x4_encap_t r; + s.a[0] = -40; + s.a[1] = -41; + s.a[2] = -42; + s.a[3] = -43; + r.v = pextrh_s (s.v, 2); + assert (r.a[0] == -42); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); +} + +static void test_pinsrh_0123_u (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 42; + s.a[1] = 0; + s.a[2] = 0; + s.a[3] = 0; + t.a[0] = 0; + t.a[1] = 0; + t.a[2] = 0; + t.a[3] = 0; + r.v = pinsrh_0_u (t.v, s.v); + r.v = pinsrh_1_u (r.v, s.v); + r.v = pinsrh_2_u (r.v, s.v); + r.v = pinsrh_3_u (r.v, s.v); + assert (r.a[0] == 42); + assert (r.a[1] == 42); + assert (r.a[2] == 42); + assert (r.a[3] == 42); +} + +static void test_pinsrh_0123_s (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -42; + s.a[1] = 0; + s.a[2] = 0; + s.a[3] = 0; + t.a[0] = 0; + t.a[1] = 0; + t.a[2] = 0; + t.a[3] = 0; + r.v = pinsrh_0_s (t.v, s.v); + r.v = pinsrh_1_s (r.v, s.v); + r.v = pinsrh_2_s (r.v, s.v); + r.v = pinsrh_3_s (r.v, s.v); + assert (r.a[0] == -42); + assert (r.a[1] == -42); + assert (r.a[2] == -42); + assert (r.a[3] == -42); +} + +static void test_pmaddhw (void) +{ + int16x4_encap_t s, t; + int32x2_encap_t r; + s.a[0] = -5; + s.a[1] = -4; + s.a[2] = -3; + s.a[3] = -2; + t.a[0] = 10; + t.a[1] = 11; + t.a[2] = 12; + t.a[3] = 13; + r.v = pmaddhw (s.v, t.v); + assert (r.a[0] == (-5*10 + -4*11)); + assert (r.a[1] == (-3*12 + -2*13)); +} + +static void test_pmaxsh (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -20; + s.a[1] = 40; + s.a[2] = -10; + s.a[3] = 50; + t.a[0] = 20; + t.a[1] = -40; + t.a[2] = 10; + t.a[3] = -50; + r.v = pmaxsh (s.v, t.v); + assert (r.a[0] == 20); + assert (r.a[1] == 40); + assert (r.a[2] == 10); + assert (r.a[3] == 50); +} + +static void test_pmaxub (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 10; + s.a[1] = 20; + s.a[2] = 30; + s.a[3] = 40; + s.a[4] = 50; + s.a[5] = 60; + s.a[6] = 70; + s.a[7] = 80; + t.a[0] = 80; + t.a[1] = 70; + t.a[2] = 60; + t.a[3] = 50; + t.a[4] = 40; + t.a[5] = 30; + t.a[6] = 20; + t.a[7] = 10; + r.v = pmaxub (s.v, t.v); + assert (r.a[0] == 80); + assert (r.a[1] == 70); + assert (r.a[2] == 60); + assert (r.a[3] == 50); + assert (r.a[4] == 50); + assert (r.a[5] == 60); + assert (r.a[6] == 70); + assert (r.a[7] == 80); +} + +static void test_pminsh (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -20; + s.a[1] = 40; + s.a[2] = -10; + s.a[3] = 50; + t.a[0] = 20; + t.a[1] = -40; + t.a[2] = 10; + t.a[3] = -50; + r.v = pminsh (s.v, t.v); + assert (r.a[0] == -20); + assert (r.a[1] == -40); + assert (r.a[2] == -10); + assert (r.a[3] == -50); +} + +static void test_pminub (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 10; + s.a[1] = 20; + s.a[2] = 30; + s.a[3] = 40; + s.a[4] = 50; + s.a[5] = 60; + s.a[6] = 70; + s.a[7] = 80; + t.a[0] = 80; + t.a[1] = 70; + t.a[2] = 60; + t.a[3] = 50; + t.a[4] = 40; + t.a[5] = 30; + t.a[6] = 20; + t.a[7] = 10; + r.v = pminub (s.v, t.v); + assert (r.a[0] == 10); + assert (r.a[1] == 20); + assert (r.a[2] == 30); + assert (r.a[3] == 40); + assert (r.a[4] == 40); + assert (r.a[5] == 30); + assert (r.a[6] == 20); + assert (r.a[7] == 10); +} + +static void test_pmovmskb_u (void) +{ + uint8x8_encap_t s; + uint8x8_encap_t r; + s.a[0] = 0xf0; + s.a[1] = 0x40; + s.a[2] = 0xf0; + s.a[3] = 0x40; + s.a[4] = 0xf0; + s.a[5] = 0x40; + s.a[6] = 0xf0; + s.a[7] = 0x40; + r.v = pmovmskb_u (s.v); + assert (r.a[0] == 0x55); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); + assert (r.a[4] == 0); + assert (r.a[5] == 0); + assert (r.a[6] == 0); + assert (r.a[7] == 0); +} + +static void test_pmovmskb_s (void) +{ + int8x8_encap_t s; + int8x8_encap_t r; + s.a[0] = -1; + s.a[1] = 1; + s.a[2] = -1; + s.a[3] = 1; + s.a[4] = -1; + s.a[5] = 1; + s.a[6] = -1; + s.a[7] = 1; + r.v = pmovmskb_s (s.v); + assert (r.a[0] == 0x55); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); + assert (r.a[4] == 0); + assert (r.a[5] == 0); + assert (r.a[6] == 0); + assert (r.a[7] == 0); +} + +static void test_pmulhuh (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 0xff00; + s.a[1] = 0xff00; + s.a[2] = 0xff00; + s.a[3] = 0xff00; + t.a[0] = 16; + t.a[1] = 16; + t.a[2] = 16; + t.a[3] = 16; + r.v = pmulhuh (s.v, t.v); + assert (r.a[0] == 0x000f); + assert (r.a[1] == 0x000f); + assert (r.a[2] == 0x000f); + assert (r.a[3] == 0x000f); +} + +static void test_pmulhh (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = 0x0ff0; + s.a[1] = 0x0ff0; + s.a[2] = 0x0ff0; + s.a[3] = 0x0ff0; + t.a[0] = -16*16; + t.a[1] = -16*16; + t.a[2] = -16*16; + t.a[3] = -16*16; + r.v = pmulhh (s.v, t.v); + assert (r.a[0] == -16); + assert (r.a[1] == -16); + assert (r.a[2] == -16); + assert (r.a[3] == -16); +} + +static void test_pmullh (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = 0x0ff0; + s.a[1] = 0x0ff0; + s.a[2] = 0x0ff0; + s.a[3] = 0x0ff0; + t.a[0] = -16*16; + t.a[1] = -16*16; + t.a[2] = -16*16; + t.a[3] = -16*16; + r.v = pmullh (s.v, t.v); + assert (r.a[0] == 4096); + assert (r.a[1] == 4096); + assert (r.a[2] == 4096); + assert (r.a[3] == 4096); +} + +static void test_pmuluw (void) +{ + uint32x2_encap_t s, t; + uint64_t r; + s.a[0] = 0xdeadbeef; + s.a[1] = 0; + t.a[0] = 0x0f00baaa; + t.a[1] = 0; + r = pmuluw (s.v, t.v); + assert (r == 0xd0cd08e1d1a70b6ull); +} + +static void test_pasubub (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 10; + s.a[1] = 20; + s.a[2] = 30; + s.a[3] = 40; + s.a[4] = 50; + s.a[5] = 60; + s.a[6] = 70; + s.a[7] = 80; + t.a[0] = 80; + t.a[1] = 70; + t.a[2] = 60; + t.a[3] = 50; + t.a[4] = 40; + t.a[5] = 30; + t.a[6] = 20; + t.a[7] = 10; + r.v = pasubub (s.v, t.v); + assert (r.a[0] == 70); + assert (r.a[1] == 50); + assert (r.a[2] == 30); + assert (r.a[3] == 10); + assert (r.a[4] == 10); + assert (r.a[5] == 30); + assert (r.a[6] == 50); + assert (r.a[7] == 70); +} + +static void test_biadd (void) +{ + uint8x8_encap_t s; + uint16x4_encap_t r; + s.a[0] = 10; + s.a[1] = 20; + s.a[2] = 30; + s.a[3] = 40; + s.a[4] = 50; + s.a[5] = 60; + s.a[6] = 70; + s.a[7] = 80; + r.v = biadd (s.v); + assert (r.a[0] == 360); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); +} + +static void test_psadbh (void) +{ + uint8x8_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 10; + s.a[1] = 20; + s.a[2] = 30; + s.a[3] = 40; + s.a[4] = 50; + s.a[5] = 60; + s.a[6] = 70; + s.a[7] = 80; + t.a[0] = 80; + t.a[1] = 70; + t.a[2] = 60; + t.a[3] = 50; + t.a[4] = 40; + t.a[5] = 30; + t.a[6] = 20; + t.a[7] = 10; + r.v = psadbh (s.v, t.v); + assert (r.a[0] == 0x0140); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); +} + +static void test_pshufh_u (void) +{ + uint16x4_encap_t s; + uint16x4_encap_t r; + s.a[0] = 1; + s.a[1] = 2; + s.a[2] = 3; + s.a[3] = 4; + r.a[0] = 0; + r.a[1] = 0; + r.a[2] = 0; + r.a[3] = 0; + r.v = pshufh_u (r.v, s.v, 0xe5); + assert (r.a[0] == 2); + assert (r.a[1] == 2); + assert (r.a[2] == 3); + assert (r.a[3] == 4); +} + +static void test_pshufh_s (void) +{ + int16x4_encap_t s; + int16x4_encap_t r; + s.a[0] = -1; + s.a[1] = 2; + s.a[2] = -3; + s.a[3] = 4; + r.a[0] = 0; + r.a[1] = 0; + r.a[2] = 0; + r.a[3] = 0; + r.v = pshufh_s (r.v, s.v, 0xe5); + assert (r.a[0] == 2); + assert (r.a[1] == 2); + assert (r.a[2] == -3); + assert (r.a[3] == 4); +} + +static void test_psllh_u (void) +{ + uint16x4_encap_t s; + uint16x4_encap_t r; + s.a[0] = 0xffff; + s.a[1] = 0xffff; + s.a[2] = 0xffff; + s.a[3] = 0xffff; + r.v = psllh_u (s.v, 1); + assert (r.a[0] == 0xfffe); + assert (r.a[1] == 0xfffe); + assert (r.a[2] == 0xfffe); + assert (r.a[3] == 0xfffe); +} + +static void test_psllw_u (void) +{ + uint32x2_encap_t s; + uint32x2_encap_t r; + s.a[0] = 0xffffffff; + s.a[1] = 0xffffffff; + r.v = psllw_u (s.v, 2); + assert (r.a[0] == 0xfffffffc); + assert (r.a[1] == 0xfffffffc); +} + +static void test_psllh_s (void) +{ + int16x4_encap_t s; + int16x4_encap_t r; + s.a[0] = -1; + s.a[1] = -1; + s.a[2] = -1; + s.a[3] = -1; + r.v = psllh_s (s.v, 1); + assert (r.a[0] == -2); + assert (r.a[1] == -2); + assert (r.a[2] == -2); + assert (r.a[3] == -2); +} + +static void test_psllw_s (void) +{ + int32x2_encap_t s; + int32x2_encap_t r; + s.a[0] = -1; + s.a[1] = -1; + r.v = psllw_s (s.v, 2); + assert (r.a[0] == -4); + assert (r.a[1] == -4); +} + +static void test_psrah_u (void) +{ + uint16x4_encap_t s; + uint16x4_encap_t r; + s.a[0] = 0xffef; + s.a[1] = 0xffef; + s.a[2] = 0xffef; + s.a[3] = 0xffef; + r.v = psrah_u (s.v, 1); + assert (r.a[0] == 0xfff7); + assert (r.a[1] == 0xfff7); + assert (r.a[2] == 0xfff7); + assert (r.a[3] == 0xfff7); +} + +static void test_psraw_u (void) +{ + uint32x2_encap_t s; + uint32x2_encap_t r; + s.a[0] = 0xffffffef; + s.a[1] = 0xffffffef; + r.v = psraw_u (s.v, 1); + assert (r.a[0] == 0xfffffff7); + assert (r.a[1] == 0xfffffff7); +} + +static void test_psrah_s (void) +{ + int16x4_encap_t s; + int16x4_encap_t r; + s.a[0] = -2; + s.a[1] = -2; + s.a[2] = -2; + s.a[3] = -2; + r.v = psrah_s (s.v, 1); + assert (r.a[0] == -1); + assert (r.a[1] == -1); + assert (r.a[2] == -1); + assert (r.a[3] == -1); +} + +static void test_psraw_s (void) +{ + int32x2_encap_t s; + int32x2_encap_t r; + s.a[0] = -2; + s.a[1] = -2; + r.v = psraw_s (s.v, 1); + assert (r.a[0] == -1); + assert (r.a[1] == -1); +} + +static void test_psrlh_u (void) +{ + uint16x4_encap_t s; + uint16x4_encap_t r; + s.a[0] = 0xffef; + s.a[1] = 0xffef; + s.a[2] = 0xffef; + s.a[3] = 0xffef; + r.v = psrlh_u (s.v, 1); + assert (r.a[0] == 0x7ff7); + assert (r.a[1] == 0x7ff7); + assert (r.a[2] == 0x7ff7); + assert (r.a[3] == 0x7ff7); +} + +static void test_psrlw_u (void) +{ + uint32x2_encap_t s; + uint32x2_encap_t r; + s.a[0] = 0xffffffef; + s.a[1] = 0xffffffef; + r.v = psrlw_u (s.v, 1); + assert (r.a[0] == 0x7ffffff7); + assert (r.a[1] == 0x7ffffff7); +} + +static void test_psrlh_s (void) +{ + int16x4_encap_t s; + int16x4_encap_t r; + s.a[0] = -1; + s.a[1] = -1; + s.a[2] = -1; + s.a[3] = -1; + r.v = psrlh_s (s.v, 1); + assert (r.a[0] == INT16x4_MAX); + assert (r.a[1] == INT16x4_MAX); + assert (r.a[2] == INT16x4_MAX); + assert (r.a[3] == INT16x4_MAX); +} + +static void test_psrlw_s (void) +{ + int32x2_encap_t s; + int32x2_encap_t r; + s.a[0] = -1; + s.a[1] = -1; + r.v = psrlw_s (s.v, 1); + assert (r.a[0] == INT32x2_MAX); + assert (r.a[1] == INT32x2_MAX); +} + +static void test_psubw_u (void) +{ + uint32x2_encap_t s, t; + uint32x2_encap_t r; + s.a[0] = 3; + s.a[1] = 4; + t.a[0] = 2; + t.a[1] = 1; + r.v = psubw_u (s.v, t.v); + assert (r.a[0] == 1); + assert (r.a[1] == 3); +} + +static void test_psubw_s (void) +{ + int32x2_encap_t s, t; + int32x2_encap_t r; + s.a[0] = -2; + s.a[1] = -1; + t.a[0] = 3; + t.a[1] = -4; + r.v = psubw_s (s.v, t.v); + assert (r.a[0] == -5); + assert (r.a[1] == 3); +} + +static void test_psubh_u (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 5; + s.a[1] = 6; + s.a[2] = 7; + s.a[3] = 8; + t.a[0] = 1; + t.a[1] = 2; + t.a[2] = 3; + t.a[3] = 4; + r.v = psubh_u (s.v, t.v); + assert (r.a[0] == 4); + assert (r.a[1] == 4); + assert (r.a[2] == 4); + assert (r.a[3] == 4); +} + +static void test_psubh_s (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -10; + s.a[1] = -20; + s.a[2] = -30; + s.a[3] = -40; + t.a[0] = 1; + t.a[1] = 2; + t.a[2] = 3; + t.a[3] = 4; + r.v = psubh_s (s.v, t.v); + assert (r.a[0] == -11); + assert (r.a[1] == -22); + assert (r.a[2] == -33); + assert (r.a[3] == -44); +} + +static void test_psubb_u (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 10; + s.a[1] = 11; + s.a[2] = 12; + s.a[3] = 13; + s.a[4] = 14; + s.a[5] = 15; + s.a[6] = 16; + s.a[7] = 17; + t.a[0] = 1; + t.a[1] = 2; + t.a[2] = 3; + t.a[3] = 4; + t.a[4] = 5; + t.a[5] = 6; + t.a[6] = 7; + t.a[7] = 8; + r.v = psubb_u (s.v, t.v); + assert (r.a[0] == 9); + assert (r.a[1] == 9); + assert (r.a[2] == 9); + assert (r.a[3] == 9); + assert (r.a[4] == 9); + assert (r.a[5] == 9); + assert (r.a[6] == 9); + assert (r.a[7] == 9); +} + +static void test_psubb_s (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -10; + s.a[1] = -20; + s.a[2] = -30; + s.a[3] = -40; + s.a[4] = -50; + s.a[5] = -60; + s.a[6] = -70; + s.a[7] = -80; + t.a[0] = 1; + t.a[1] = 2; + t.a[2] = 3; + t.a[3] = 4; + t.a[4] = 5; + t.a[5] = 6; + t.a[6] = 7; + t.a[7] = 8; + r.v = psubb_s (s.v, t.v); + assert (r.a[0] == -11); + assert (r.a[1] == -22); + assert (r.a[2] == -33); + assert (r.a[3] == -44); + assert (r.a[4] == -55); + assert (r.a[5] == -66); + assert (r.a[6] == -77); + assert (r.a[7] == -88); +} + +static void test_psubd_u (void) +{ + uint64_t d = 789012; + uint64_t e = 123456; + uint64_t r; + r = psubd_u (d, e); + assert (r == 665556); +} + +static void test_psubd_s (void) +{ + int64_t d = 123456; + int64_t e = -789012; + int64_t r; + r = psubd_s (d, e); + assert (r == 912468); +} + +static void test_psubsh (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -1; + s.a[1] = 0; + s.a[2] = 1; + s.a[3] = 2; + t.a[0] = -INT16x4_MAX; + t.a[1] = -INT16x4_MAX; + t.a[2] = -INT16x4_MAX; + t.a[3] = -INT16x4_MAX; + r.v = psubsh (s.v, t.v); + assert (r.a[0] == INT16x4_MAX - 1); + assert (r.a[1] == INT16x4_MAX); + assert (r.a[2] == INT16x4_MAX); + assert (r.a[3] == INT16x4_MAX); +} + +static void test_psubsb (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -6; + s.a[1] = -5; + s.a[2] = -4; + s.a[3] = -3; + s.a[4] = -2; + s.a[5] = -1; + s.a[6] = 0; + s.a[7] = 1; + t.a[0] = -INT8x8_MAX; + t.a[1] = -INT8x8_MAX; + t.a[2] = -INT8x8_MAX; + t.a[3] = -INT8x8_MAX; + t.a[4] = -INT8x8_MAX; + t.a[5] = -INT8x8_MAX; + t.a[6] = -INT8x8_MAX; + t.a[7] = -INT8x8_MAX; + r.v = psubsb (s.v, t.v); + assert (r.a[0] == INT8x8_MAX - 6); + assert (r.a[1] == INT8x8_MAX - 5); + assert (r.a[2] == INT8x8_MAX - 4); + assert (r.a[3] == INT8x8_MAX - 3); + assert (r.a[4] == INT8x8_MAX - 2); + assert (r.a[5] == INT8x8_MAX - 1); + assert (r.a[6] == INT8x8_MAX); + assert (r.a[7] == INT8x8_MAX); +} + +static void test_psubush (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 0; + s.a[1] = 1; + s.a[2] = 2; + s.a[3] = 3; + t.a[0] = 1; + t.a[1] = 1; + t.a[2] = 3; + t.a[3] = 3; + r.v = psubush (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); +} + +static void test_psubusb (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 0; + s.a[1] = 1; + s.a[2] = 2; + s.a[3] = 3; + s.a[4] = 4; + s.a[5] = 5; + s.a[6] = 6; + s.a[7] = 7; + t.a[0] = 1; + t.a[1] = 1; + t.a[2] = 3; + t.a[3] = 3; + t.a[4] = 5; + t.a[5] = 5; + t.a[6] = 7; + t.a[7] = 7; + r.v = psubusb (s.v, t.v); + assert (r.a[0] == 0); + assert (r.a[1] == 0); + assert (r.a[2] == 0); + assert (r.a[3] == 0); + assert (r.a[4] == 0); + assert (r.a[5] == 0); + assert (r.a[6] == 0); + assert (r.a[7] == 0); +} + +static void test_punpckhbh_s (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -1; + s.a[1] = -3; + s.a[2] = -5; + s.a[3] = -7; + s.a[4] = -9; + s.a[5] = -11; + s.a[6] = -13; + s.a[7] = -15; + t.a[0] = 2; + t.a[1] = 4; + t.a[2] = 6; + t.a[3] = 8; + t.a[4] = 10; + t.a[5] = 12; + t.a[6] = 14; + t.a[7] = 16; + r.v = punpckhbh_s (s.v, t.v); + assert (r.a[0] == -9); + assert (r.a[1] == 10); + assert (r.a[2] == -11); + assert (r.a[3] == 12); + assert (r.a[4] == -13); + assert (r.a[5] == 14); + assert (r.a[6] == -15); + assert (r.a[7] == 16); +} + +static void test_punpckhbh_u (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + s.a[2] = 5; + s.a[3] = 7; + s.a[4] = 9; + s.a[5] = 11; + s.a[6] = 13; + s.a[7] = 15; + t.a[0] = 2; + t.a[1] = 4; + t.a[2] = 6; + t.a[3] = 8; + t.a[4] = 10; + t.a[5] = 12; + t.a[6] = 14; + t.a[7] = 16; + r.v = punpckhbh_u (s.v, t.v); + assert (r.a[0] == 9); + assert (r.a[1] == 10); + assert (r.a[2] == 11); + assert (r.a[3] == 12); + assert (r.a[4] == 13); + assert (r.a[5] == 14); + assert (r.a[6] == 15); + assert (r.a[7] == 16); +} + +static void test_punpckhhw_s (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -1; + s.a[1] = 3; + s.a[2] = -5; + s.a[3] = 7; + t.a[0] = -2; + t.a[1] = 4; + t.a[2] = -6; + t.a[3] = 8; + r.v = punpckhhw_s (s.v, t.v); + assert (r.a[0] == -5); + assert (r.a[1] == -6); + assert (r.a[2] == 7); + assert (r.a[3] == 8); +} + +static void test_punpckhhw_u (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + s.a[2] = 5; + s.a[3] = 7; + t.a[0] = 2; + t.a[1] = 4; + t.a[2] = 6; + t.a[3] = 8; + r.v = punpckhhw_u (s.v, t.v); + assert (r.a[0] == 5); + assert (r.a[1] == 6); + assert (r.a[2] == 7); + assert (r.a[3] == 8); +} + +static void test_punpckhwd_s (void) +{ + int32x2_encap_t s, t; + int32x2_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + t.a[0] = 2; + t.a[1] = -4; + r.v = punpckhwd_s (s.v, t.v); + assert (r.a[0] == 3); + assert (r.a[1] == -4); +} + +static void test_punpckhwd_u (void) +{ + uint32x2_encap_t s, t; + uint32x2_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + t.a[0] = 2; + t.a[1] = 4; + r.v = punpckhwd_u (s.v, t.v); + assert (r.a[0] == 3); + assert (r.a[1] == 4); +} + +static void test_punpcklbh_s (void) +{ + int8x8_encap_t s, t; + int8x8_encap_t r; + s.a[0] = -1; + s.a[1] = -3; + s.a[2] = -5; + s.a[3] = -7; + s.a[4] = -9; + s.a[5] = -11; + s.a[6] = -13; + s.a[7] = -15; + t.a[0] = 2; + t.a[1] = 4; + t.a[2] = 6; + t.a[3] = 8; + t.a[4] = 10; + t.a[5] = 12; + t.a[6] = 14; + t.a[7] = 16; + r.v = punpcklbh_s (s.v, t.v); + assert (r.a[0] == -1); + assert (r.a[1] == 2); + assert (r.a[2] == -3); + assert (r.a[3] == 4); + assert (r.a[4] == -5); + assert (r.a[5] == 6); + assert (r.a[6] == -7); + assert (r.a[7] == 8); +} + +static void test_punpcklbh_u (void) +{ + uint8x8_encap_t s, t; + uint8x8_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + s.a[2] = 5; + s.a[3] = 7; + s.a[4] = 9; + s.a[5] = 11; + s.a[6] = 13; + s.a[7] = 15; + t.a[0] = 2; + t.a[1] = 4; + t.a[2] = 6; + t.a[3] = 8; + t.a[4] = 10; + t.a[5] = 12; + t.a[6] = 14; + t.a[7] = 16; + r.v = punpcklbh_u (s.v, t.v); + assert (r.a[0] == 1); + assert (r.a[1] == 2); + assert (r.a[2] == 3); + assert (r.a[3] == 4); + assert (r.a[4] == 5); + assert (r.a[5] == 6); + assert (r.a[6] == 7); + assert (r.a[7] == 8); +} + +static void test_punpcklhw_s (void) +{ + int16x4_encap_t s, t; + int16x4_encap_t r; + s.a[0] = -1; + s.a[1] = 3; + s.a[2] = -5; + s.a[3] = 7; + t.a[0] = -2; + t.a[1] = 4; + t.a[2] = -6; + t.a[3] = 8; + r.v = punpcklhw_s (s.v, t.v); + assert (r.a[0] == -1); + assert (r.a[1] == -2); + assert (r.a[2] == 3); + assert (r.a[3] == 4); +} + +static void test_punpcklhw_u (void) +{ + uint16x4_encap_t s, t; + uint16x4_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + s.a[2] = 5; + s.a[3] = 7; + t.a[0] = 2; + t.a[1] = 4; + t.a[2] = 6; + t.a[3] = 8; + r.v = punpcklhw_u (s.v, t.v); + assert (r.a[0] == 1); + assert (r.a[1] == 2); + assert (r.a[2] == 3); + assert (r.a[3] == 4); +} + +static void test_punpcklwd_s (void) +{ + int32x2_encap_t s, t; + int32x2_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + t.a[0] = -2; + t.a[1] = 4; + r.v = punpcklwd_s (s.v, t.v); + assert (r.a[0] == 1); + assert (r.a[1] == -2); +} + +static void test_punpcklwd_u (void) +{ + uint32x2_encap_t s, t; + uint32x2_encap_t r; + s.a[0] = 1; + s.a[1] = 3; + t.a[0] = 2; + t.a[1] = 4; + r.v = punpcklwd_u (s.v, t.v); + assert (r.a[0] == 1); + assert (r.a[1] == 2); +} + +int main (void) +{ + test_packsswh (); + test_packsshb (); + test_packushb (); + test_paddw_u (); + test_paddw_s (); + test_paddh_u (); + test_paddh_s (); + test_paddb_u (); + test_paddb_s (); + test_paddd_u (); + test_paddd_s (); + test_paddsh (); + test_paddsb (); + test_paddush (); + test_paddusb (); + test_pandn_ud (); + test_pandn_sd (); + test_pandn_uw (); + test_pandn_sw (); + test_pandn_uh (); + test_pandn_sh (); + test_pandn_ub (); + test_pandn_sb (); + test_pavgh (); + test_pavgb (); + test_pcmpeqw_u (); + test_pcmpeqh_u (); + test_pcmpeqb_u (); + test_pcmpeqw_s (); + test_pcmpeqh_s (); + test_pcmpeqb_s (); + test_pcmpgtw_u (); + test_pcmpgth_u (); + test_pcmpgtb_u (); + test_pcmpgtw_s (); + test_pcmpgth_s (); + test_pcmpgtb_s (); + test_pextrh_u (); + test_pextrh_s (); + test_pinsrh_0123_u (); + test_pinsrh_0123_s (); + test_pmaddhw (); + test_pmaxsh (); + test_pmaxub (); + test_pminsh (); + test_pminub (); + test_pmovmskb_u (); + test_pmovmskb_s (); + test_pmulhuh (); + test_pmulhh (); + test_pmullh (); + test_pmuluw (); + test_pasubub (); + test_biadd (); + test_psadbh (); + test_pshufh_u (); + test_pshufh_s (); + test_psllh_u (); + test_psllw_u (); + test_psllh_s (); + test_psllw_s (); + test_psrah_u (); + test_psraw_u (); + test_psrah_s (); + test_psraw_s (); + test_psrlh_u (); + test_psrlw_u (); + test_psrlh_s (); + test_psrlw_s (); + test_psubw_u (); + test_psubw_s (); + test_psubh_u (); + test_psubh_s (); + test_psubb_u (); + test_psubb_s (); + test_psubd_u (); + test_psubd_s (); + test_psubsh (); + test_psubsb (); + test_psubush (); + test_psubusb (); + test_punpckhbh_s (); + test_punpckhbh_u (); + test_punpckhhw_s (); + test_punpckhhw_u (); + test_punpckhwd_s (); + test_punpckhwd_u (); + test_punpcklbh_s (); + test_punpcklbh_u (); + test_punpcklhw_s (); + test_punpcklhw_u (); + test_punpcklwd_s (); + test_punpcklwd_u (); + return 0; +} diff --git a/gcc/testsuite/gfortran.dg/array_constructor_25.f03 b/gcc/testsuite/gfortran.dg/array_constructor_25.f03 new file mode 100644 index 00000000000..b18746815c5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_25.f03 @@ -0,0 +1,12 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } + +! PR fortran/36492 +! Check for incorrect error message with -std=f2003. +! Reduced test based on the one from comment #4, PR 36492. + +type t + character (2) :: arr (1) = [ "a" ] +end type t + +end diff --git a/gcc/testsuite/gfortran.dg/array_constructor_26.f03 b/gcc/testsuite/gfortran.dg/array_constructor_26.f03 new file mode 100644 index 00000000000..a226f6ae00c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_26.f03 @@ -0,0 +1,18 @@ +! { dg-do compile } + +! PR fortran/36492 +! Check for incorrect error message with -std=f2003. +! Test from comment #4, PR 36492 causing ICE. + +MODULE WinData + IMPLICIT NONE + INTEGER (1), PARAMETER :: MAXFLD = 25_1, MAXHED = 5_1, MAXCHR = 80_1 + integer :: i + TYPE TWindowData + CHARACTER (MAX_FLD_HED, 1) :: DWFdHd(MAXFLD) = [(" ", i = 1, MAXFLD)] + ! { dg-error "no IMPLICIT type" "" { target *-*-* } 12 } + ! { dg-error "specification expression" "" { target *-*-* } 12 } + END TYPE TWindowData +END MODULE WinData + +! { dg-final { cleanup-modules "WinData" } } diff --git a/gcc/testsuite/gfortran.dg/array_constructor_27.f03 b/gcc/testsuite/gfortran.dg/array_constructor_27.f03 new file mode 100644 index 00000000000..6cd4d62dac7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_27.f03 @@ -0,0 +1,15 @@ +! { dg-do compile } + +! PR fortran/36492 +! Check for incorrect error message with -std=f2003. +! Reduced test triggering the ICE mentioned in comment #4, PR 36492. + +implicit none + +type t + character (a) :: arr (1) = [ "a" ] + ! { dg-error "no IMPLICIT type" "" { target *-*-* } 10 } + ! { dg-error "specification expression" "" { target *-*-* } 10 } +end type t + +end diff --git a/gcc/testsuite/gfortran.dg/array_constructor_28.f03 b/gcc/testsuite/gfortran.dg/array_constructor_28.f03 new file mode 100644 index 00000000000..382e49aef88 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_28.f03 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } + +! PR fortran/36492 +! Check that the error is still emitted for really incorrect constructor. + +type t + character (2) :: arr (2) = [ "a", "ab" ] ! { dg-error "Different CHARACTER" } +end type t + +end diff --git a/gcc/testsuite/gfortran.dg/array_constructor_29.f03 b/gcc/testsuite/gfortran.dg/array_constructor_29.f03 new file mode 100644 index 00000000000..03534fa81ed --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_29.f03 @@ -0,0 +1,13 @@ +! { dg-do compile } + +! PR fortran/36492 +! Similar to the ICE-test, but now test it works for real constants. + +implicit none + +integer, parameter :: a = 42 +type t + character (a) :: arr (1) = [ "a" ] +end type t + +end diff --git a/gcc/testsuite/gfortran.dg/array_constructor_30.f03 b/gcc/testsuite/gfortran.dg/array_constructor_30.f03 new file mode 100644 index 00000000000..587ce03977d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_30.f03 @@ -0,0 +1,16 @@ +! { dg-do compile } + +! PR fortran/36492 +! Similar to the ICE-test, but now test for complaint about constant +! specification expression. + +implicit none + +integer :: a = 42 +type t + character (a) :: arr (1) = [ "a" ] + ! { dg-error "in the expression" "" { target *-*-* } 11 } + ! { dg-error "specification expression" "" { target *-*-* } 11 } +end type t + +end diff --git a/gcc/testsuite/gfortran.dg/array_constructor_type_19.f03 b/gcc/testsuite/gfortran.dg/array_constructor_type_19.f03 new file mode 100644 index 00000000000..f3c8fd5ef4f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_type_19.f03 @@ -0,0 +1,9 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } + +! PR fortran/36517 +! Check for incorrect error message with -std=f2003. +! This is the test of comment #1, PR 36517. + +print *, [ character(len=2) :: 'a', 'bb' ] +end diff --git a/gcc/testsuite/gfortran.dg/array_constructor_type_20.f03 b/gcc/testsuite/gfortran.dg/array_constructor_type_20.f03 new file mode 100644 index 00000000000..9702669d4a8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_type_20.f03 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } + +! PR fortran/36517 +! Check for incorrect error message with -std=f2003. +! This is the original test from PR 36517. + +CHARACTER (len=*) MY_STRING(1:3) +PARAMETER ( MY_STRING = (/ CHARACTER (len=3) :: "AC", "B", "C" /) ) +CHARACTER (len=*), PARAMETER :: str(2) = [ CHARACTER (len=3) :: 'A', 'cc' ] +END diff --git a/gcc/testsuite/gfortran.dg/array_constructor_type_21.f03 b/gcc/testsuite/gfortran.dg/array_constructor_type_21.f03 new file mode 100644 index 00000000000..41e4da346c9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/array_constructor_type_21.f03 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } + +! PR fortran/36492 +! Check that it works with a typespec even for not-the-same-length elements. + +type t + character (1) :: arr (2) = [ character(len=2) :: "a", "ab" ] +end type t + +end diff --git a/gcc/testsuite/gfortran.dg/arrayio_0.f90 b/gcc/testsuite/gfortran.dg/arrayio_0.f90 index 1331cf2edda..3801a69e9c2 100644 --- a/gcc/testsuite/gfortran.dg/arrayio_0.f90 +++ b/gcc/testsuite/gfortran.dg/arrayio_0.f90 @@ -8,7 +8,7 @@ character(len=48), dimension(2) :: iue equivalence (iu, iue) integer, dimension(4) :: v = (/2,1,4,3/) - iu = (/"Vector","subscripts","not","allowed!"/) + iu = (/"Vector ","subscripts","not ","allowed! "/) read (iu, '(a12/)') buff read (iue(1), '(4a12)') buff read (iu(4:1:-1), '(a12/)') buff diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_1.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_1.f90 new file mode 100644 index 00000000000..45b21d21e70 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_1.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-fbounds-check" } +! { dg-shouldfail "foo" } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. + + call test ("this is long") +contains + subroutine test(s) + character(len=*) :: s + character(len=128) :: arr(2) + arr = (/ s, "abc" /) + end subroutine test +end +! { dg-output "Different CHARACTER lengths \\(12/3\\) in array constructor" } diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_2.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_2.f90 new file mode 100644 index 00000000000..e0cbf1061d7 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_2.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-fbounds-check" } +! { dg-shouldfail "foo" } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. + + call test ("this is long") +contains + subroutine test(s) + character(len=*) :: s + character(len=128) :: arr(2) + arr = (/ "abc", s /) + end subroutine test +end +! { dg-output "Different CHARACTER lengths \\(3/12\\) in array constructor" } diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_3.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_3.f90 new file mode 100644 index 00000000000..5e566ba9bc9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_3.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. +! This should not need any -fbounds-check and is enabled all the time. + + character(len=128) :: arr(2) = (/ "abc", "foobar" /) ! { dg-error "Different CHARACTER lengths" } + arr = (/ "abc", "foobar" /) ! { dg-error "Different CHARACTER lengths" } +end diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_4.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_4.f90 new file mode 100644 index 00000000000..1d3bac83a71 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_4.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-fbounds-check" } +! { dg-shouldfail "foo" } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. + + call test ("short", "this is long") +contains + subroutine test(r, s) + character(len=*) :: r, s + character(len=128) :: arr(2) + arr = (/ r, s /) + end subroutine test +end +! { dg-output "Different CHARACTER lengths \\(5/12\\) in array constructor" } diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_5.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_5.f90 new file mode 100644 index 00000000000..ad7f1b05469 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_5.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. +! No need for -fbounds-check, enabled unconditionally. + + character(len=5) :: s = "hello" + character(len=128) :: arr(3) + arr = (/ "abc", "foo", s /) ! { dg-error "Different CHARACTER lengths" } +end diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_6.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_6.f90 new file mode 100644 index 00000000000..c6f89e0de92 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_6.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-fbounds-check" } +! { dg-shouldfail "foo" } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. + + call test ("short", "also5") +contains + subroutine test(r, s) + character(len=*) :: r, s + character(len=128) :: arr(3) + arr = (/ r, s, "this is too long" /) + end subroutine test +end +! { dg-output "Different CHARACTER lengths \\(5/16\\) in array constructor" } diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_7.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_7.f90 new file mode 100644 index 00000000000..2a13be2beb0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_7.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-fbounds-check" } +! { dg-shouldfail "foo" } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. + + call test ("short") +contains + subroutine test(s) + character(len=*) :: s + character(len=128) :: arr(3) + arr = (/ "this is long", "this one too", s /) + end subroutine test +end +! { dg-output "Different CHARACTER lengths \\(12/5\\) in array constructor" } diff --git a/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_8.f90 b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_8.f90 new file mode 100644 index 00000000000..0d4ad0cfeb4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bounds_check_array_ctor_8.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-fbounds-check" } +! { dg-shouldfail "foo" } +! +! PR 36112 +! Check correct bounds-checking behaviour for character-array-constructors. + + call test ("short") +contains + subroutine test(s) + character(len=*) :: s + character(len=128) :: arr(3) + arr = (/ s, "this is long", "this one too" /) + end subroutine test +end +! { dg-output "Different CHARACTER lengths \\(5/12\\) in array constructor" } diff --git a/gcc/testsuite/gfortran.dg/char_cons_len.f90 b/gcc/testsuite/gfortran.dg/char_cons_len.f90 index e50d7532d93..cf920bdfb29 100644 --- a/gcc/testsuite/gfortran.dg/char_cons_len.f90 +++ b/gcc/testsuite/gfortran.dg/char_cons_len.f90 @@ -3,7 +3,7 @@ ! constructor, as an argument for LEN, would cause an ICE. ! character(11) :: chr1, chr2 - i = len ((/chr1, chr2, "ggg"/)) + i = len ((/chr1, chr2, "ggg "/)) j = len ((/"abcdefghijk", chr1, chr2/)) k = len ((/'hello ','goodbye'/)) l = foo ("yes siree, Bob") diff --git a/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90 b/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90 index 7975a7e424b..920e1066014 100644 --- a/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90 +++ b/gcc/testsuite/gfortran.dg/char_initialiser_actual.f90 @@ -5,10 +5,10 @@ program char_initialiser character*5, dimension(3) :: x character*5, dimension(:), pointer :: y - x=(/"is Ja","ne Fo","nda"/) + x=(/"is Ja","ne Fo","nda "/) call sfoo ("is Ja", x(1)) - call afoo ((/"is Ja","ne Fo","nda"/), x) - y => pfoo ((/"is Ja","ne Fo","nda"/)) + call afoo ((/"is Ja","ne Fo","nda "/), x) + y => pfoo ((/"is Ja","ne Fo","nda "/)) call afoo (y, x) contains subroutine sfoo(ch1, ch2) diff --git a/gcc/testsuite/gfortran.dg/char_length_1.f90 b/gcc/testsuite/gfortran.dg/char_length_1.f90 index e372343d0b2..3f92f0efa90 100644 --- a/gcc/testsuite/gfortran.dg/char_length_1.f90 +++ b/gcc/testsuite/gfortran.dg/char_length_1.f90 @@ -7,12 +7,13 @@ ! Contributed by Tobias Burnus <tobias.burnus@physik.fu-berlin.de> ! program test + implicit none character(10) :: a(3) character(10) :: b(3)= & - (/ 'Takata ', 'Tanaka', 'Hayashi' /) ! { dg-error "same length" } + (/ 'Takata ', 'Tanaka', 'Hayashi' /) ! { dg-error "Different CHARACTER" } character(4) :: c = "abcde" ! { dg-warning "being truncated" } - a = (/ 'Takata', 'Tanaka ', 'Hayashi' /) ! { dg-error "same length" } + a = (/ 'Takata', 'Tanaka ', 'Hayashi' /) ! { dg-error "Different CHARACTER" } a = (/ 'Takata ', 'Tanaka ', 'Hayashi' /) - b = "abc" + b = "abc" ! { dg-error "no IMPLICIT" } c = "abcdefg" ! { dg-warning "will be truncated" } end program test diff --git a/gcc/testsuite/gfortran.dg/fmt_l.f90 b/gcc/testsuite/gfortran.dg/fmt_l.f90 index 2a8b6e3bcb3..9dc4f570473 100644 --- a/gcc/testsuite/gfortran.dg/fmt_l.f90 +++ b/gcc/testsuite/gfortran.dg/fmt_l.f90 @@ -52,34 +52,34 @@ program test_l end program test_l ! { dg-output "At line 14 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 15 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 19 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 20 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 24 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 25 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 29 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 30 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 34 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 35 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 39 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 40 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 44 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 45 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 49 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } ! { dg-output "At line 50 of file.*" } -! { dg-output "Fortran runtime warning: Positive width required in format\n" } +! { dg-output "Fortran runtime warning: Positive width required in format(\n|\r\n|\r)" } diff --git a/gcc/testsuite/gfortran.dg/fseek.f90 b/gcc/testsuite/gfortran.dg/fseek.f90 index 2bf2e0dc8dd..2649063ac59 100644 --- a/gcc/testsuite/gfortran.dg/fseek.f90 +++ b/gcc/testsuite/gfortran.dg/fseek.f90 @@ -17,16 +17,16 @@ PROGRAM test_fseek IF (FTELL(fd) /= 11 + newline_length) CALL abort() ! move backward from current position - CALL FSEEK(fd, -12, SEEK_CUR, ierr) + CALL FSEEK(fd, -11 - newline_length, SEEK_CUR, ierr) IF (ierr /= 0 .OR. FTELL(fd) /= 0) CALL abort() ! move to negative position (error) CALL FSEEK(fd, -1, SEEK_SET, ierr) IF (ierr == 0 .OR. FTELL(fd) /= 0) CALL abort() - ! move forward from end (12 + 10) + ! move forward from end (11 + 10 + newline) CALL FSEEK(fd, 10, SEEK_END, ierr) - IF (ierr /= 0 .OR. FTELL(fd) /= 22) CALL abort() + IF (ierr /= 0 .OR. FTELL(fd) /= 21 + newline_length) CALL abort() ! set position (0) CALL FSEEK(fd, 0, SEEK_SET, ierr) diff --git a/gcc/testsuite/gfortran.dg/namelist_48.f90 b/gcc/testsuite/gfortran.dg/namelist_48.f90 new file mode 100644 index 00000000000..e9a29285b17 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_48.f90 @@ -0,0 +1,15 @@ +! { dg-do run } +! { dg-options "-fbackslash" } +! PR36538 namelist failure with tabs preceding object name + program check1 + integer x + namelist/casein/x + open(1, status="scratch") + write(1,'(a)') "&CASEIN" + write(1,'(a)') "\t\tx = 1" + write(1,'(a)') "/" + rewind(1) + x = 0 + read(1,casein) + if (x.ne.1) call abort + end diff --git a/gcc/testsuite/gfortran.dg/namelist_49.f90 b/gcc/testsuite/gfortran.dg/namelist_49.f90 new file mode 100644 index 00000000000..aec83eea965 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_49.f90 @@ -0,0 +1,19 @@ +! { dg-do run } +! { dg-options "-fbackslash" } +! PR36546 Namelist error with tab following a comma and newline + program check1 + real a,b,c + namelist/CASEDAT/A,B,C + open(1, status="scratch") + write(1,'(a)') "&CASEDAT" + write(1,'(a)') "\t\tA = 1.0,\t\tB = 2.0," + write(1,'(a)') "\t\tC = 3.0," + write(1,'(a)') " /" + rewind(1) + a = 0.0 + b = 0.0 + c = 0.0 + read(1,casedat) + if ((a.ne.1.0) .or. (b.ne.2.0) .or. (c.ne.3.0)) call abort + end + diff --git a/gcc/testsuite/gfortran.dg/no_range_check_2.f90 b/gcc/testsuite/gfortran.dg/no_range_check_2.f90 new file mode 100644 index 00000000000..4b45c4c8e4f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/no_range_check_2.f90 @@ -0,0 +1,11 @@ +! { dg-do run } +! { dg-options "-fno-range-check" } +! PR36515 Integer read a value overflow for an invalid integer. +! This tests that -fno-range-check allows this legacy behavior at runtime. +program int_range +character(25) :: inputline = "-2147483648" +integer*4 smallest +read(inputline,100) smallest +100 format(1i11) +if (smallest.ne.-2147483648) call abort +end diff --git a/gcc/testsuite/gfortran.dg/pr15959.f90 b/gcc/testsuite/gfortran.dg/pr15959.f90 index b7f3719dfe4..c28dce5255e 100644 --- a/gcc/testsuite/gfortran.dg/pr15959.f90 +++ b/gcc/testsuite/gfortran.dg/pr15959.f90 @@ -1,5 +1,5 @@ ! { dg-do run } ! Test initializer of character array. PR15959 -character (*), parameter :: a (1:2) = (/'ab', 'abc'/) +character (*), parameter :: a (1:2) = (/'ab ', 'abc'/) if (a(2) .ne. 'abc') call abort() end diff --git a/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90 b/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90 index a4da6a53969..96bf283f036 100644 --- a/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90 +++ b/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90 @@ -92,7 +92,7 @@ contains end subroutine integer8_to_complex4 subroutine character16_to_complex8 - character(16), parameter :: c1(2) = (/"abcdefghijklmnop","qrstuvwxyz1234567890"/) + character(16), parameter :: c1(2) = (/"abcdefghijklmnop","qrstuvwxyz123456"/) character(16) :: c2(2) = c1 complex(8), parameter :: z1(2) = transfer (c1, (1.0_8,1.0_8), 2) complex(8) :: z2(2) diff --git a/gcc/testsuite/gfortran.dg/used_types_20.f90 b/gcc/testsuite/gfortran.dg/used_types_20.f90 new file mode 100644 index 00000000000..c08235c67f2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_types_20.f90 @@ -0,0 +1,49 @@ +! { dg-do compile } +! Tests the fix for PR36366 a regression in which the order of USE statements +! in 'test2' would cause the result of 'test1' not to have a reference to +! the derived type 'inner'. +! +! Contributed by Jakub Jelinek <jakub@gcc.gnu.org> +! +MODULE types + IMPLICIT NONE + TYPE :: inner + INTEGER, POINTER :: i(:) + END TYPE inner + + TYPE :: outer + TYPE(inner), POINTER :: inr(:) + END TYPE outer +END MODULE types + +MODULE mymod + IMPLICIT NONE +CONTAINS + FUNCTION test1() + USE types + IMPLICIT NONE + TYPE(outer), POINTER :: test1 + NULLIFY(test1) + END FUNCTION test1 +END MODULE mymod + +MODULE test + IMPLICIT NONE +CONTAINS + + SUBROUTINE test2(a) + USE mymod + USE types + IMPLICIT NONE + TYPE(outer), INTENT(INOUT) :: a + INTEGER :: i + i = a%inr(1)%i(1) + END SUBROUTINE test2 + + SUBROUTINE test3(a) + USE types + IMPLICIT NONE + TYPE(outer), INTENT(IN) :: a + END SUBROUTINE test3 +END MODULE test +! { dg-final { cleanup-modules "types mymod test" } } diff --git a/gcc/testsuite/gfortran.dg/widechar_IO_1.f90 b/gcc/testsuite/gfortran.dg/widechar_IO_1.f90 new file mode 100644 index 00000000000..0fe479cda64 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/widechar_IO_1.f90 @@ -0,0 +1,20 @@ +! { dg-do run } +! Wide chracter I/O test 1, formatted and mixed kind +! Test case developed by Jerry DeLisle <jvdelisle@gcc.gnu.org> +program test1 + integer, parameter :: k4 = 4 + character(len=10,kind=4) :: wide + character(len=10,kind=1) :: thin + character(kind=1,len=25) :: buffer + wide=k4_"Goodbye!" + thin="Hello!" + write(buffer, '(a)') wide + if (buffer /= "Goodbye!") call abort + open(10, form="formatted", access="stream", status="scratch") + write(10, '(a)') thin + rewind(10) + read(10, '(a)') wide + if (wide /= k4_"Hello!") call abort + write(buffer,*) thin, ">",wide,"<" + if (buffer /= " Hello! >Hello! <") call abort +end program test1 diff --git a/gcc/testsuite/gfortran.dg/widechar_IO_2.f90 b/gcc/testsuite/gfortran.dg/widechar_IO_2.f90 new file mode 100644 index 00000000000..6b13e4f93f1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/widechar_IO_2.f90 @@ -0,0 +1,19 @@ +! { dg-do run } +! Wide chracter I/O test 2, formatted array write and read +! Test case developed by Jerry DeLisle <jvdelisle@gcc.gnu.org> +program chkdata + integer, parameter :: k4=4 + character(len=7, kind=k4), dimension(3) :: mychar + character(50) :: buffer + mychar(1) = k4_"abc1234" + mychar(2) = k4_"def5678" + mychar(3) = k4_"ghi9012" + buffer = "" + write(buffer,'(3(a))') mychar(2:3), mychar(1) + if (buffer /= "def5678ghi9012abc1234") call abort + write(buffer,'(3(a))') mychar + if (buffer /= "abc1234def5678ghi9012") call abort + mychar = "" + read(buffer,'(3(a))') mychar + if (any(mychar.ne.[ k4_"abc1234",k4_"def5678",k4_"ghi9012" ])) call abort +end program chkdata diff --git a/gcc/testsuite/gfortran.dg/widechar_IO_3.f90 b/gcc/testsuite/gfortran.dg/widechar_IO_3.f90 new file mode 100644 index 00000000000..6f4a10c857e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/widechar_IO_3.f90 @@ -0,0 +1,23 @@ +! { dg-do run } +! Wide chracter I/O test 3, unformatted arrays +! Test case developed by Jerry DeLisle <jvdelisle@gcc.gnu.org> +program test1 + integer, parameter :: k4 = 4 + character(len=10,kind=4) :: wide + character(len=10,kind=4), dimension(5,7) :: widearray + wide = k4_"abcdefg" + widearray = k4_"1234abcd" + open(10, form="unformatted", status="scratch") + write(10) wide + rewind(10) + wide = "wrong" + read(10) wide + if (wide /= k4_"abcdefg") call abort + rewind(10) + write(10) widearray(2:4,3:7) + widearray(2:4,3:7)="" + rewind(10) + read(10) widearray(2:4,3:7) + close(10) + if (any(widearray.ne.k4_"1234abcd")) call abort +end program test1 diff --git a/gcc/testsuite/gfortran.dg/widechar_IO_4.f90 b/gcc/testsuite/gfortran.dg/widechar_IO_4.f90 new file mode 100644 index 00000000000..e108b15c4f5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/widechar_IO_4.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! { dg-options -fbackslash } +! Wide chracter I/O test 4, formatted ISO-8859-1 characters in string +! Test case developed by Jerry DeLisle <jvdelisle@gcc.gnu.org> +! Compile with -fbackslash +integer, parameter :: k4 = 4 +character(kind=1,len=15) :: buffer +character(kind=1, len=1) :: c1, c2 +character(kind=4,len=20) :: str = k4_'X\xF8öABC' ! ISO-8859-1 encoded string +buffer = "" +write(buffer,'(3a)')':',trim(str),':' +if (buffer.ne.':X\xF8öABC: ') call abort +str = "" +read(buffer,'(3a)') c1,str(1:6),c2 +if (c1.ne.':') call abort +if (str.ne.k4_'X\xF8öAB') call abort +if (c2.ne.'C') call abort +end diff --git a/gcc/testsuite/gnat.dg/task_stack_align.adb b/gcc/testsuite/gnat.dg/task_stack_align.adb new file mode 100644 index 00000000000..1151a913beb --- /dev/null +++ b/gcc/testsuite/gnat.dg/task_stack_align.adb @@ -0,0 +1,31 @@ +-- { dg-do run } + +with Ada.Text_IO; use Ada.Text_IO; +with System.Storage_Elements; use System.Storage_Elements; + +procedure Task_Stack_Align is + + type Align_Me is record + Value : Integer; + end record; + for Align_Me'Alignment use Standard'Maximum_Alignment; + + procedure Check_Local_Alignment_From (Context : String) is + Object : Align_Me; + begin + if To_Integer (Object'Address) mod Object'Alignment /= 0 then + Put_Line ("alignment check failed in " & Context); + end if; + end; + + task type T; + + task body T is + begin + Check_Local_Alignment_From ("task T"); + end; + + Tasks : array (1 .. 50) of T; +begin + Check_Local_Alignment_From ("environment"); +end; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 04717c6f099..223ee16d9ee 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -398,6 +398,20 @@ proc check_effective_target_trampolines { } { return 1 } +# Return 1 if according to target_info struct and explicit target list +# target is supposed to keep null pointer checks. This could be due to +# use of option fno-delete-null-pointer-checks or hardwired in target. + +proc check_effective_target_keeps_null_pointer_checks { } { + if [target_info exists keeps_null_pointer_checks] { + return 1 + } + if { [istarget avr-*-*] } { + return 1; + } + return 0 +} + # Return true if profiling is supported on the target. proc check_profiling_available { test_what } { @@ -1249,6 +1263,17 @@ proc check_effective_target_arm_neon_hw { } { } "-mfpu=neon -mfloat-abi=softfp"] } +# Return 1 if this a Loongson-2E or -2F target using an ABI that supports +# the Loongson vector modes. + +proc check_effective_target_mips_loongson { } { + return [check_no_compiler_messages loongson assembly { + #if !defined(__mips_loongson_vector_rev) + #error FOO + #endif + }] +} + # Return 1 if this is a PowerPC target with floating-point registers. proc check_effective_target_powerpc_fprs { } { @@ -1266,6 +1291,24 @@ proc check_effective_target_powerpc_fprs { } { } } +# Return 1 if this is a PowerPC target with hardware double-precision +# floating point. + +proc check_effective_target_powerpc_hard_double { } { + if { [istarget powerpc*-*-*] + || [istarget rs6000-*-*] } { + return [check_no_compiler_messages powerpc_hard_double object { + #ifdef _SOFT_DOUBLE + #error soft double + #else + int dummy; + #endif + }] + } else { + return 0 + } +} + # Return 1 if this is a PowerPC target supporting -maltivec. proc check_effective_target_powerpc_altivec_ok { } { |