diff options
author | Ian Lance Taylor <iant@golang.org> | 2022-02-16 12:21:31 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2022-02-16 12:21:31 -0800 |
commit | b43d6db9780462273c4d885a0111e3376c114c61 (patch) | |
tree | 0dff7e34fe65a75ba82e4a13d69991fdaea7c5eb /gcc/testsuite | |
parent | 9419b14e109a2807361a9f695f5767f03dfa0cae (diff) | |
parent | 24ca97325cab7bc454c785d55f37120fe7ea6f74 (diff) | |
download | gcc-b43d6db9780462273c4d885a0111e3376c114c61.zip gcc-b43d6db9780462273c4d885a0111e3376c114c61.tar.gz gcc-b43d6db9780462273c4d885a0111e3376c114c61.tar.bz2 |
Merge from trunk revision 24ca97325cab7bc454c785d55f37120fe7ea6f74.
Diffstat (limited to 'gcc/testsuite')
223 files changed, 3685 insertions, 300 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d50556d..5230f00 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,155 @@ +2022-02-15 Peter Bergner <bergner@linux.ibm.com> + + * gcc.target/powerpc/htm-1.c: Retry intermittent failing tbegins. + +2022-02-15 Andrew MacLeod <amacleod@redhat.com> + + PR tree-optimization/104526 + * gcc.dg/pr104526.c: New. + +2022-02-15 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/104524 + * gcc.dg/analyzer/pr104524.c: New test. + +2022-02-15 David Malcolm <dmalcolm@redhat.com> + + PR analyzer/102692 + * gcc.dg/analyzer/pr102692-2.c: New test. + * gcc.dg/analyzer/pr102692.c: Remove xfail. Remove -O2 from + options and move to... + * gcc.dg/analyzer/torture/pr102692.c: ...here. + +2022-02-15 Tobias Burnus <tobias@codesourcery.com> + + * gfortran.dg/gomp/depend-4.f90: Add VALUE test, update scan test. + * gfortran.dg/gomp/depend-5.f90: Fix scan tree for -m32. + * gfortran.dg/gomp/depend-6.f90: New test. + +2022-02-15 Richard Sandiford <richard.sandiford@arm.com> + + * gcc.target/aarch64/max_plus_1.c: New test. + * gcc.target/aarch64/max_plus_2.c: Likewise. + * gcc.target/aarch64/max_plus_3.c: Likewise. + * gcc.target/aarch64/max_plus_4.c: Likewise. + * gcc.target/aarch64/max_plus_5.c: Likewise. + * gcc.target/aarch64/max_plus_6.c: Likewise. + * gcc.target/aarch64/max_plus_7.c: Likewise. + * gcc.target/aarch64/min_plus_1.c: Likewise. + * gcc.target/aarch64/min_plus_2.c: Likewise. + * gcc.target/aarch64/min_plus_3.c: Likewise. + * gcc.target/aarch64/min_plus_4.c: Likewise. + * gcc.target/aarch64/min_plus_5.c: Likewise. + * gcc.target/aarch64/min_plus_6.c: Likewise. + * gcc.target/aarch64/min_plus_7.c: Likewise. + +2022-02-15 Richard Sandiford <richard.sandiford@arm.com> + + * gcc.target/aarch64/store_v2vec_lanes.c: Add -fno-tree-vectorize. + +2022-02-15 Richard Sandiford <richard.sandiford@arm.com> + + * gcc.target/aarch64/shl-combine-2.c: New test. + * gcc.target/aarch64/shl-combine-3.c: Likewise. + * gcc.target/aarch64/shl-combine-4.c: Likewise. + * gcc.target/aarch64/shl-combine-5.c: Likewise. + * gcc.target/aarch64/xtn-combine-1.c: Likewise. + * gcc.target/aarch64/xtn-combine-2.c: Likewise. + * gcc.target/aarch64/xtn-combine-3.c: Likewise. + * gcc.target/aarch64/xtn-combine-4.c: Likewise. + * gcc.target/aarch64/xtn-combine-5.c: Likewise. + * gcc.target/aarch64/xtn-combine-6.c: Likewise. + +2022-02-15 Richard Sandiford <richard.sandiford@arm.com> + + * gcc.target/aarch64/ldp_stp_5.c: Require -mstrict-align. + * gcc.target/aarch64/ldp_stp_14.h, + * gcc.target/aarch64/ldp_stp_14.c: New test. + * gcc.target/aarch64/ldp_stp_15.c: Likewise. + * gcc.target/aarch64/ldp_stp_16.c: Likewise. + * gcc.target/aarch64/ldp_stp_17.c: Likewise. + * gcc.target/aarch64/ldp_stp_18.c: Likewise. + * gcc.target/aarch64/ldp_stp_19.c: Likewise. + +2022-02-15 Richard Biener <rguenther@suse.de> + + PR tree-optimization/104543 + * gcc.dg/torture/pr104543.c: New testcase. + +2022-02-15 Tobias Burnus <tobias@codesourcery.com> + + * gfortran.dg/gomp/depend-4.f90: New test. + * gfortran.dg/gomp/depend-5.f90: New test. + +2022-02-15 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/104522 + * gcc.dg/pr104522.c: New test. + +2022-02-15 Richard Biener <rguenther@suse.de> + + PR tree-optimization/104519 + * gcc.dg/torture/pr104519.c: New testcase. + +2022-02-15 Jakub Jelinek <jakub@redhat.com> + + PR debug/104517 + * gcc.dg/gomp/pr104517.c: New test. + +2022-02-15 Jason Merrill <jason@redhat.com> + + PR c++/104107 + PR c++/95036 + * g++.dg/cpp0x/alias-decl-ttp2.C: New test. + * g++.dg/cpp1z/ttp2.C: New test. + +2022-02-14 Michael Meissner <meissner@the-meissners.org> + + PR target/104253 + * gcc.target/powerpc/pr104253.c: New test. + +2022-02-14 Harald Anlauf <anlauf@gmx.de> + + PR fortran/104211 + * gfortran.dg/pr104211.f90: New test. + +2022-02-14 Jakub Jelinek <jakub@redhat.com> + + PR c++/104513 + * g++.dg/cpp1y/constexpr-104513.C: New test. + * g++.dg/cpp2a/constexpr-dtor12.C: New test. + +2022-02-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/104528 + * gfortran.dg/pr104528.f: New testcase. + +2022-02-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/104511 + * gcc.dg/pr104511.c: New testcase. + +2022-02-14 Richard Biener <rguenther@suse.de> + + PR c/104505 + * c-c++-common/pr104505.c: New testcase. + +2022-02-14 Richard Biener <rguenther@suse.de> + + PR middle-end/104497 + * c-c++-common/torture/pr104497.c: New testcase. + +2022-02-13 Mikael Morin <mikael@gcc.gnu.org> + + PR fortran/104228 + * gfortran.dg/asan/associate_58.f90: New test. + * gfortran.dg/asan/associate_59.f90: New test. + +2022-02-13 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/pr103771-2.c: New test. + * gcc.target/i386/pr103771-3.c: New test. + 2022-02-12 Jakub Jelinek <jakub@redhat.com> PR sanitizer/104449 diff --git a/gcc/testsuite/c-c++-common/gomp/atomic-31.c b/gcc/testsuite/c-c++-common/gomp/atomic-31.c new file mode 100644 index 0000000..9ec3140 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/atomic-31.c @@ -0,0 +1,11 @@ +/* c/104531 */ +/* { dg-do compile } */ + +int x; + +void +foo (_Complex int y) +{ + #pragma omp atomic compare /* { dg-error "invalid operands" } */ + x = x > y ? y : x; +} diff --git a/gcc/testsuite/c-c++-common/pr104505.c b/gcc/testsuite/c-c++-common/pr104505.c new file mode 100644 index 0000000..7fa3d84 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr104505.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ + +typedef char __attribute__((__vector_size__ (8))) U; +typedef short __attribute__((__vector_size__ (16))) V; + +U u; + +void +foo (V v) +{ + u = __builtin_shufflevector (u, u, __builtin_convertvector (v, U)); /* { dg-error "invalid element index" } */ +} diff --git a/gcc/testsuite/c-c++-common/torture/pr104497.c b/gcc/testsuite/c-c++-common/torture/pr104497.c new file mode 100644 index 0000000..c63fc02 --- /dev/null +++ b/gcc/testsuite/c-c++-common/torture/pr104497.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ + +typedef int __attribute__((vector_size(16))) vec_t; + +vec_t src, inv, res; + +void test(int i) +{ + vec_t y={0}; + y[i] = (i & 1 ? inv : src)[i]; + res = y; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-ttp2.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-ttp2.C new file mode 100644 index 0000000..230b277 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-ttp2.C @@ -0,0 +1,25 @@ +// PR c++/104107 +// { dg-do compile { target c++11 } } + +template<int targ_id, typename t_parameter, + template<typename T, const T&> class tt_w_data> +struct tt_main { + static t_parameter m_parameter; + template<template<typename T, const T&> class t_data> + using t_make = t_data<t_parameter, m_parameter>; + using t_data = t_make<tt_w_data>; +}; + +template<int targ_id, typename t_parameter, + template<typename T, const T&> class tt_w_data> +t_parameter tt_main<targ_id, t_parameter, tt_w_data>::m_parameter; + +template<typename T, const T&> struct P {}; +struct t_parameter {}; + +using toto = tt_main<0, t_parameter, P>; + +int main() { + toto t; + return 0; +} diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-104513.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-104513.C new file mode 100644 index 0000000..4fa78a3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-104513.C @@ -0,0 +1,10 @@ +// PR c++/104513 +// { dg-do compile { target c++14 } } + +struct A { + int a1; + short a2, a3; + long a4; + constexpr A() : a1(42), a2(42), a3(42), a4(42) { return; } +}; +constexpr A a; diff --git a/gcc/testsuite/g++.dg/cpp1z/ttp2.C b/gcc/testsuite/g++.dg/cpp1z/ttp2.C new file mode 100644 index 0000000..1f161e5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/ttp2.C @@ -0,0 +1,21 @@ +// PR c++/95036 +// { dg-do compile { target c++17 } } + +namespace a { +template <int b> struct c { static constexpr int d = b; }; +template <bool, typename e = void> using f = e; +template <typename e, e...> struct g; +template <typename> struct array; +} // namespace a +template <template <class> class h> struct i { + template <template <class, auto...> class, class = void> struct n; + template <class j> struct n<h, j> : a::c<true> {}; + template <template <class> class k, class = a::f<n<k>::d>> void function(); +}; +template <template <class> class... l> struct derived : i<l>... { + using i<l>::function...; +}; +int main() { + derived<a::array, a::g> m; + m.function<a::array>(); +} diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor12.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor12.C new file mode 100644 index 0000000..19f9099b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor12.C @@ -0,0 +1,13 @@ +// PR c++/104513 +// { dg-do compile { target c++20 } } + +struct S { + constexpr S () : s (nullptr) {} + constexpr ~S () { delete s; } + int *s; +}; +struct T : S { + constexpr T () : S () {} + constexpr ~T () { s = new int (42); return; } +}; +constexpr T t; diff --git a/gcc/testsuite/g++.dg/template/non-dependent21.C b/gcc/testsuite/g++.dg/template/non-dependent21.C new file mode 100644 index 0000000..89900837 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/non-dependent21.C @@ -0,0 +1,9 @@ +// PR c++/104507 + +extern const char *_k_errmsg[]; + +template<class> +const char* DoFoo(int __r, int __s) { + const char* n = _k_errmsg[(bool)__r && __s ? 1 : 2]; + return n; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr102692-2.c b/gcc/testsuite/gcc.dg/analyzer/pr102692-2.c new file mode 100644 index 0000000..c72fde2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr102692-2.c @@ -0,0 +1,22 @@ +/* { dg-additional-options "-O1" } */ + +struct Lisp_Overlay +{ + struct Lisp_Overlay *next; +}; + +void +test_1 (struct Lisp_Overlay *tail, long prev) +{ + long end; + if (!tail || end < prev || !tail->next) /* { dg-warning "use of uninitialized value 'end'" } */ + return; +} + +void +test_2 (struct Lisp_Overlay *tail, long prev) +{ + long end; + if (tail && end < prev && !tail->next) /* { dg-warning "use of uninitialized value 'end'" } */ + return; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr104524.c b/gcc/testsuite/gcc.dg/analyzer/pr104524.c new file mode 100644 index 0000000..875098c --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr104524.c @@ -0,0 +1,9 @@ +int src[1]; + +int +main (int c, char **a) +{ + __builtin_memcpy (*a, src, c); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/analyzer/pr102692.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c index c8993c8..a6c6bc4 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr102692.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c @@ -1,4 +1,4 @@ -/* { dg-additional-options "-O2 -Wno-analyzer-too-complex" } */ +/* { dg-additional-options "-Wno-analyzer-too-complex" } */ /* TODO: remove the need for -Wno-analyzer-too-complex. */ struct lisp; @@ -73,7 +73,7 @@ fix_overlays_before (struct buffer *bp, long prev, long pos) parent = tail; tail = tail->next; } - if (!tail || end < prev || !tail->next) /* { dg-bogus "use of uninitialized value 'end'" "uninit" { xfail *-*-* } } */ + if (!tail || end < prev || !tail->next) /* { dg-bogus "use of uninitialized value 'end'" "uninit" } */ /* { dg-bogus "dereference of NULL 'tail'" "null deref" { target *-*-* } .-1 } */ return; right_pair = parent; diff --git a/gcc/testsuite/gcc.dg/dfp/pr104510.c b/gcc/testsuite/gcc.dg/dfp/pr104510.c new file mode 100644 index 0000000..85f4e97 --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/pr104510.c @@ -0,0 +1,12 @@ +/* PR c/104510 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +float f; +_Decimal64 d; + +int +foo (void) +{ + return d > (_Decimal32) (_Decimal64) f; +} diff --git a/gcc/testsuite/gcc.dg/gomp/pr104517.c b/gcc/testsuite/gcc.dg/gomp/pr104517.c new file mode 100644 index 0000000..efb3175 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr104517.c @@ -0,0 +1,54 @@ +/* PR debug/104517 */ +/* { dg-do compile } */ +/* { dg-options "-O1 -fcompare-debug -fopenmp -fno-tree-ter -save-temps" } */ + +enum { + omp_default_mem_alloc, + omp_large_cap_mem_alloc, + omp_const_mem_alloc, + omp_high_bw_mem_alloc +} omp_allocator_handle_t; + +int t, bar_nte, bar_tl, bar_i3, bar_dd; + +#pragma omp threadprivate(t) +#pragma omp declare target +int f, l, ll, r, r2; +#pragma omp end declare target + +void +bar (int *idp, int s, int nth, int g, int nta, int fi, int pp, int *q, + int ntm) +{ + int p = 0, i2 = 0, i1 = 0, m = 0, d = 0; + +#pragma omp target parallel for \ + device(p) firstprivate (f) allocate (f) in_reduction(+:r2) + for (int i = 0; i < 4; i++) + ll++; + +#pragma omp target parallel for \ + device(d) map (m) \ + if (target: p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \ + if (parallel: i2) reduction(+:r) num_threads (nth) linear (ll) \ + schedule(static) collapse(1) nowait depend(inout: d) allocate (f) \ + in_reduction(+:r2) + for (int i = 0; i < 4; i++) + ll++; + +#pragma omp taskloop simd firstprivate(f) lastprivate(s) grainsize(g) \ + collapse(1) untied if (i1) final(fi) mergeable nogroup \ + priority(pp) linear(ll) aligned(q) allocate(f) + for (int i = 0; i < 4; i++) + ll++; + +#pragma omp taskloop simd firstprivate(f) lastprivate(s) num_tasks(nta) \ + collapse(1) if (i1) final(fi) priority(pp) safelen(8) simdlen(4) \ + linear(ll) aligned(q) nontemporal(ntm) order(concurrent) allocate(f) + for (int i = 0; i < 4; i++) + ll++; + +#pragma omp parallel master firstprivate(f) shared(nth) proc_bind(spread) \ + copyin(t) allocate(f) + ; +} diff --git a/gcc/testsuite/gcc.dg/pr104511.c b/gcc/testsuite/gcc.dg/pr104511.c new file mode 100644 index 0000000..ad5430c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr104511.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target dfp } } */ +/* { dg-options "-O -Wno-psabi" } */ + +typedef _Float64 __attribute__((__vector_size__ (32))) F; +typedef _Decimal32 __attribute__((__vector_size__ (16))) D; + +extern void bar (void); + +D g; +void +foo (F f) +{ + D d = __builtin_convertvector (f, D); + bar (); + g = d; +} diff --git a/gcc/testsuite/gcc.dg/pr104522.c b/gcc/testsuite/gcc.dg/pr104522.c new file mode 100644 index 0000000..4d1d630 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr104522.c @@ -0,0 +1,14 @@ +/* PR middle-end/104522 */ +/* { dg-do compile } */ +/* { dg-options "-O -fcompare-debug -dP" } */ + +typedef short __attribute__((__vector_size__(16))) V; +long double x; + +void +foo (void) +{ + V t = { 512, 0, 0, 0, 16384 }; + long double u = *(long double *) &t; + x /= u; +} diff --git a/gcc/testsuite/gcc.dg/pr104526.c b/gcc/testsuite/gcc.dg/pr104526.c new file mode 100644 index 0000000..a295308 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr104526.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-evrp" } */ + +void foo(void); + +static int a, b = 1, *c = &b; +int main() { + for (; a; a--) { + int d = 2 >> (1 / *c); + if (!d) + foo(); + } +} + +/* { dg-final { scan-tree-dump-not "foo" "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/pr104544.c b/gcc/testsuite/gcc.dg/pr104544.c new file mode 100644 index 0000000..275b666 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr104544.c @@ -0,0 +1,19 @@ +/* PR rtl-optimization/104544 */ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O2 -fcompare-debug" } */ + +int m, n; +__int128 q; + +void +bar (unsigned __int128 x, int y) +{ + if (x) + q += y; +} + +void +foo (void) +{ + bar (!!q - 1, (m += m ? m : 1) < n); +} diff --git a/gcc/testsuite/gcc.dg/torture/pr104519.c b/gcc/testsuite/gcc.dg/torture/pr104519.c new file mode 100644 index 0000000..389c7bb --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr104519.c @@ -0,0 +1,10 @@ +/* { dg-do run } */ + +signed char a, b; +int main() +{ + for (b = -7; b; b += 3) + if (a) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pr104543.c b/gcc/testsuite/gcc.dg/torture/pr104543.c new file mode 100644 index 0000000..4896351 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr104543.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-additional-options "-floop-unroll-and-jam" } */ + +int a[3], b, c; +static int e() +{ + if (!c) { + for (b = 0; b < 3; b++) + for (c = 0; c < 3; c++) + a[c] ^= 1; + return -1; + } + return 0; +} +int main() +{ + e(); + if (a[1] != 1) + __builtin_abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/atomic-inst-cas.c b/gcc/testsuite/gcc.target/aarch64/atomic-inst-cas.c index f6f2892..0b4533a 100644 --- a/gcc/testsuite/gcc.target/aarch64/atomic-inst-cas.c +++ b/gcc/testsuite/gcc.target/aarch64/atomic-inst-cas.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv8-a+lse" } */ +/* -Winvalid-memory-model warnings are issued before the dead invalid calls + are removed. */ +/* { dg-options "-O2 -march=armv8-a+lse -Wno-invalid-memory-model" } */ /* Test ARMv8.1-A CAS instruction. */ diff --git a/gcc/testsuite/gcc.target/aarch64/bic-bitmask-1.c b/gcc/testsuite/gcc.target/aarch64/bic-bitmask-1.c index 568c1ff..bcb9cdd 100644 --- a/gcc/testsuite/gcc.target/aarch64/bic-bitmask-1.c +++ b/gcc/testsuite/gcc.target/aarch64/bic-bitmask-1.c @@ -10,4 +10,4 @@ uint32x4_t foo (int32x4_t a) return vceqq_s32 (vbicq_s32 (a, cst), zero); } -/* { dg-final { scan-assembler-not {\tbic\t} { xfail { aarch64*-*-* } } } } */ +/* { dg-final { scan-assembler-not {\tbic\t} } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_14.c b/gcc/testsuite/gcc.target/aarch64/ldp_stp_14.c new file mode 100644 index 0000000..c7b5f7d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_14.c @@ -0,0 +1,89 @@ +/* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#include "ldp_stp_14.h" + +/* +** const_2_int16_t_0: +** str wzr, \[x0\] +** ret +*/ +CONST_FN (2, int16_t, 0); + +/* +** const_4_int16_t_0: +** str xzr, \[x0\] +** ret +*/ +CONST_FN (4, int16_t, 0); + +/* +** const_8_int16_t_0: +** stp xzr, xzr, \[x0\] +** ret +*/ +CONST_FN (8, int16_t, 0); + +/* No preference between vectorizing or not vectorizing here. */ +CONST_FN (16, int16_t, 0); + +/* +** const_32_int16_t_0: +** movi v([0-9]+)\.4s, .* +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +CONST_FN (32, int16_t, 0); + +/* No preference between vectorizing or not vectorizing here. */ +CONST_FN (2, int16_t, 1); + +/* +** const_4_int16_t_1: +** movi v([0-9]+)\.4h, .* +** str d\1, \[x0\] +** ret +*/ +CONST_FN (4, int16_t, 1); + +/* +** const_8_int16_t_1: +** movi v([0-9]+)\.8h, .* +** str q\1, \[x0\] +** ret +*/ +CONST_FN (8, int16_t, 1); + +/* Fuzzy match due to PR104387. */ +/* +** dup_2_int16_t: +** ... +** strh w1, \[x0, #?2\] +** ret +*/ +DUP_FN (2, int16_t); + +/* +** dup_4_int16_t: +** dup v([0-9]+)\.4h, w1 +** str d\1, \[x0\] +** ret +*/ +DUP_FN (4, int16_t); + +/* +** dup_8_int16_t: +** dup v([0-9]+)\.8h, w1 +** str q\1, \[x0\] +** ret +*/ +DUP_FN (8, int16_t); + +/* +** cons2_1_int16_t: +** strh w1, \[x0\] +** strh w2, \[x0, #?2\] +** ret +*/ +CONS2_FN (1, int16_t); diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_14.h b/gcc/testsuite/gcc.target/aarch64/ldp_stp_14.h new file mode 100644 index 0000000..39c463f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_14.h @@ -0,0 +1,50 @@ +#include <stdint.h> + +#define PRAGMA(X) _Pragma (#X) +#define UNROLL(COUNT) PRAGMA (GCC unroll (COUNT)) + +#define CONST_FN(COUNT, TYPE, VAL) \ + void \ + const_##COUNT##_##TYPE##_##VAL (TYPE *x) \ + { \ + UNROLL (COUNT) \ + for (int i = 0; i < COUNT; ++i) \ + x[i] = VAL; \ + } + +#define DUP_FN(COUNT, TYPE) \ + void \ + dup_##COUNT##_##TYPE (TYPE *x, TYPE val) \ + { \ + UNROLL (COUNT) \ + for (int i = 0; i < COUNT; ++i) \ + x[i] = val; \ + } + +#define CONS2_FN(COUNT, TYPE) \ + void \ + cons2_##COUNT##_##TYPE (TYPE *x, TYPE val0, TYPE val1) \ + { \ + UNROLL (COUNT) \ + for (int i = 0; i < COUNT * 2; i += 2) \ + { \ + x[i + 0] = val0; \ + x[i + 1] = val1; \ + } \ + } + +#define CONS4_FN(COUNT, TYPE) \ + void \ + cons4_##COUNT##_##TYPE (TYPE *x, TYPE val0, TYPE val1, \ + TYPE val2, TYPE val3) \ + { \ + UNROLL (COUNT) \ + for (int i = 0; i < COUNT * 4; i += 4) \ + { \ + x[i + 0] = val0; \ + x[i + 1] = val1; \ + x[i + 2] = val2; \ + x[i + 3] = val3; \ + } \ + } + diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_15.c b/gcc/testsuite/gcc.target/aarch64/ldp_stp_15.c new file mode 100644 index 0000000..131cd0a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_15.c @@ -0,0 +1,137 @@ +/* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#include "ldp_stp_14.h" + +/* +** const_2_int32_t_0: +** str xzr, \[x0\] +** ret +*/ +CONST_FN (2, int32_t, 0); + +/* +** const_4_int32_t_0: +** stp xzr, xzr, \[x0\] +** ret +*/ +CONST_FN (4, int32_t, 0); + +/* No preference between vectorizing or not vectorizing here. */ +CONST_FN (8, int32_t, 0); + +/* +** const_16_int32_t_0: +** movi v([0-9]+)\.4s, .* +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +CONST_FN (16, int32_t, 0); + +/* No preference between vectorizing or not vectorizing here. */ +CONST_FN (2, int32_t, 1); + +/* +** const_4_int32_t_1: +** movi v([0-9]+)\.4s, .* +** str q\1, \[x0\] +** ret +*/ +CONST_FN (4, int32_t, 1); + +/* +** const_8_int32_t_1: +** movi v([0-9]+)\.4s, .* +** stp q\1, q\1, \[x0\] +** ret +*/ +CONST_FN (8, int32_t, 1); + +/* +** dup_2_int32_t: +** stp w1, w1, \[x0\] +** ret +*/ +DUP_FN (2, int32_t); + +/* +** dup_4_int32_t: +** stp w1, w1, \[x0\] +** stp w1, w1, \[x0, #?8\] +** ret +*/ +DUP_FN (4, int32_t); + +/* +** dup_8_int32_t: +** dup v([0-9]+)\.4s, w1 +** stp q\1, q\1, \[x0\] +** ret +*/ +DUP_FN (8, int32_t); + +/* +** cons2_1_int32_t: +** stp w1, w2, \[x0\] +** ret +*/ +CONS2_FN (1, int32_t); + +/* +** cons2_2_int32_t: +** stp w1, w2, \[x0\] +** stp w1, w2, \[x0, #?8\] +** ret +*/ +CONS2_FN (2, int32_t); + +/* +** cons2_4_int32_t: +** stp w1, w2, \[x0\] +** stp w1, w2, \[x0, #?8\] +** stp w1, w2, \[x0, #?16\] +** stp w1, w2, \[x0, #?24\] +** ret +*/ +CONS2_FN (4, int32_t); + +/* No preference between vectorizing or not vectorizing here. */ +CONS2_FN (8, int32_t); + +/* +** cons2_16_int32_t: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS2_FN (16, int32_t); + +/* +** cons4_1_int32_t: +** stp w1, w2, \[x0\] +** stp w3, w4, \[x0, #?8\] +** ret +*/ +CONS4_FN (1, int32_t); + +/* +** cons4_2_int32_t: +** stp w1, w2, \[x0\] +** stp w3, w4, \[x0, #?8\] +** stp w1, w2, \[x0, #?16\] +** stp w3, w4, \[x0, #?24\] +** ret +*/ +CONS4_FN (2, int32_t); + +/* No preference between vectorizing or not vectorizing here. */ +CONS4_FN (4, int32_t); + +/* +** cons4_8_int32_t: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS4_FN (8, int32_t); diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_16.c b/gcc/testsuite/gcc.target/aarch64/ldp_stp_16.c new file mode 100644 index 0000000..8ab117c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_16.c @@ -0,0 +1,133 @@ +/* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#include "ldp_stp_14.h" + +/* +** const_2_float_0: +** str xzr, \[x0\] +** ret +*/ +CONST_FN (2, float, 0); + +/* +** const_4_float_0: +** stp xzr, xzr, \[x0\] +** ret +*/ +CONST_FN (4, float, 0); + +/* No preference between vectorizing or not vectorizing here. */ +CONST_FN (8, float, 0); + +/* +** const_16_float_0: +** movi v([0-9]+)\.4s, .* +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +CONST_FN (16, float, 0); + +/* +** const_2_float_1: +** fmov v([0-9]+)\.2s, .* +** str d\1, \[x0\] +** ret +*/ +CONST_FN (2, float, 1); + +/* +** const_4_float_1: +** fmov v([0-9]+)\.4s, .* +** str q\1, \[x0\] +** ret +*/ +CONST_FN (4, float, 1); + +/* +** dup_2_float: +** stp s0, s0, \[x0\] +** ret +*/ +DUP_FN (2, float); + +/* No preference between vectorizing or not vectorizing here. */ +DUP_FN (4, float); + +/* +** dup_8_float: +** dup v([0-9]+)\.4s, v0.s\[0\] +** stp q\1, q\1, \[x0\] +** ret +*/ +DUP_FN (8, float); + +/* +** cons2_1_float: +** stp s0, s1, \[x0\] +** ret +*/ +CONS2_FN (1, float); + +/* +** cons2_2_float: +** stp s0, s1, \[x0\] +** stp s0, s1, \[x0, #?8\] +** ret +*/ +CONS2_FN (2, float); + +/* +** cons2_4_float: { target aarch64_little_endian } +** ins v0.s\[1\], v1.s\[0\] +** stp d0, d0, \[x0\] +** stp d0, d0, \[x0, #?16\] +** ret +*/ +/* +** cons2_4_float: { target aarch64_big_endian } +** ins v1.s\[1\], v0.s\[0\] +** stp d1, d1, \[x0\] +** stp d1, d1, \[x0, #?16\] +** ret +*/ +CONS2_FN (4, float); + +/* +** cons2_8_float: +** dup v([0-9]+)\.4s, .* +** ... +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +CONS2_FN (8, float); + +/* +** cons4_1_float: +** stp s0, s1, \[x0\] +** stp s2, s3, \[x0, #?8\] +** ret +*/ +CONS4_FN (1, float); + +/* +** cons4_2_float: +** stp s0, s1, \[x0\] +** stp s2, s3, \[x0, #?8\] +** stp s0, s1, \[x0, #?16\] +** stp s2, s3, \[x0, #?24\] +** ret +*/ +CONS4_FN (2, float); + +/* +** cons4_4_float: +** ins v([0-9]+)\.s.* +** ... +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +CONS4_FN (4, float); diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_17.c b/gcc/testsuite/gcc.target/aarch64/ldp_stp_17.c new file mode 100644 index 0000000..c1122fc --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_17.c @@ -0,0 +1,120 @@ +/* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#include "ldp_stp_14.h" + +/* +** const_2_int64_t_0: +** stp xzr, xzr, \[x0\] +** ret +*/ +CONST_FN (2, int64_t, 0); + +/* No preference between vectorizing or not vectorizing here. */ +CONST_FN (4, int64_t, 0); + +/* +** const_8_int64_t_0: +** movi v([0-9]+)\.4s, .* +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +CONST_FN (8, int64_t, 0); + +/* +** dup_2_int64_t: +** stp x1, x1, \[x0\] +** ret +*/ +DUP_FN (2, int64_t); + +/* +** dup_4_int64_t: +** stp x1, x1, \[x0\] +** stp x1, x1, \[x0, #?16\] +** ret +*/ +DUP_FN (4, int64_t); + +/* No preference between vectorizing or not vectorizing here. */ +DUP_FN (8, int64_t); + +/* +** dup_16_int64_t: +** dup v([0-9])\.2d, x1 +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** stp q\1, q\1, \[x0, #?64\] +** stp q\1, q\1, \[x0, #?96\] +** ret +*/ +DUP_FN (16, int64_t); + +/* +** cons2_1_int64_t: +** stp x1, x2, \[x0\] +** ret +*/ +CONS2_FN (1, int64_t); + +/* +** cons2_2_int64_t: +** stp x1, x2, \[x0\] +** stp x1, x2, \[x0, #?16\] +** ret +*/ +CONS2_FN (2, int64_t); + +/* +** cons2_4_int64_t: +** stp x1, x2, \[x0\] +** stp x1, x2, \[x0, #?16\] +** stp x1, x2, \[x0, #?32\] +** stp x1, x2, \[x0, #?48\] +** ret +*/ +CONS2_FN (4, int64_t); + +/* No preference between vectorizing or not vectorizing here. */ +CONS2_FN (8, int64_t); + +/* +** cons2_16_int64_t: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS2_FN (16, int64_t); + +/* +** cons4_1_int64_t: +** stp x1, x2, \[x0\] +** stp x3, x4, \[x0, #?16\] +** ret +*/ +CONS4_FN (1, int64_t); + +/* +** cons4_2_int64_t: +** stp x1, x2, \[x0\] +** stp x3, x4, \[x0, #?16\] +** stp x1, x2, \[x0, #?32\] +** stp x3, x4, \[x0, #?48\] +** ret +*/ +CONS4_FN (2, int64_t); + +/* No preference between vectorizing or not vectorizing here. */ +CONS4_FN (4, int64_t); + +/* We should probably vectorize this, but currently don't. */ +CONS4_FN (8, int64_t); + +/* +** cons4_16_int64_t: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS4_FN (16, int64_t); diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_18.c b/gcc/testsuite/gcc.target/aarch64/ldp_stp_18.c new file mode 100644 index 0000000..eaa855c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_18.c @@ -0,0 +1,123 @@ +/* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#include "ldp_stp_14.h" + +/* +** const_2_double_0: +** stp xzr, xzr, \[x0\] +** ret +*/ +CONST_FN (2, double, 0); + +/* No preference between vectorizing or not vectorizing here. */ +CONST_FN (4, double, 0); + +/* +** const_8_double_0: +** movi v([0-9]+)\.2d, .* +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +CONST_FN (8, double, 0); + +/* +** dup_2_double: +** stp d0, d0, \[x0\] +** ret +*/ +DUP_FN (2, double); + +/* +** dup_4_double: +** stp d0, d0, \[x0\] +** stp d0, d0, \[x0, #?16\] +** ret +*/ +DUP_FN (4, double); + +/* +** dup_8_double: +** dup v([0-9])\.2d, v0\.d\[0\] +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** ret +*/ +DUP_FN (8, double); + +/* +** dup_16_double: +** dup v([0-9])\.2d, v0\.d\[0\] +** stp q\1, q\1, \[x0\] +** stp q\1, q\1, \[x0, #?32\] +** stp q\1, q\1, \[x0, #?64\] +** stp q\1, q\1, \[x0, #?96\] +** ret +*/ +DUP_FN (16, double); + +/* +** cons2_1_double: +** stp d0, d1, \[x0\] +** ret +*/ +CONS2_FN (1, double); + +/* +** cons2_2_double: +** stp d0, d1, \[x0\] +** stp d0, d1, \[x0, #?16\] +** ret +*/ +CONS2_FN (2, double); + +/* +** cons2_4_double: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS2_FN (4, double); + +/* +** cons2_8_double: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS2_FN (8, double); + +/* +** cons4_1_double: +** stp d0, d1, \[x0\] +** stp d2, d3, \[x0, #?16\] +** ret +*/ +CONS4_FN (1, double); + +/* +** cons4_2_double: +** stp d0, d1, \[x0\] +** stp d2, d3, \[x0, #?16\] +** stp d0, d1, \[x0, #?32\] +** stp d2, d3, \[x0, #?48\] +** ret +*/ +CONS4_FN (2, double); + +/* +** cons2_8_double: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS4_FN (4, double); + +/* +** cons2_8_double: +** ... +** stp q[0-9]+, .* +** ret +*/ +CONS4_FN (8, double); diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_19.c b/gcc/testsuite/gcc.target/aarch64/ldp_stp_19.c new file mode 100644 index 0000000..9eb4163 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_19.c @@ -0,0 +1,6 @@ +/* { dg-options "-O2 -mstrict-align" } */ + +#include "ldp_stp_5.c" + +/* { dg-final { scan-assembler-times {stp\tq[0-9]+, q[0-9]} 3 { xfail *-*-* } } } */ +/* { dg-final { scan-assembler-times {str\tq[0-9]+} 1 { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/ldp_stp_5.c b/gcc/testsuite/gcc.target/aarch64/ldp_stp_5.c index 9426618..56d1d3c 100644 --- a/gcc/testsuite/gcc.target/aarch64/ldp_stp_5.c +++ b/gcc/testsuite/gcc.target/aarch64/ldp_stp_5.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -mstrict-align" } */ double arr[4][4]; diff --git a/gcc/testsuite/gcc.target/aarch64/max_plus_1.c b/gcc/testsuite/gcc.target/aarch64/max_plus_1.c new file mode 100644 index 0000000..ef336ae --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/max_plus_1.c @@ -0,0 +1,149 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** adds (w[0-9]+), w0, #4 +** csel w0, \1, wzr, g[te] +** ret +*/ +/* +** f2: +** adds (w[0-9]+), w0, #4 +** csel w0, \1, wzr, g[te] +** ret +*/ +/* +** f3: +** adds (w[0-9]+), w0, #5 +** csinc w0, \1, wzr, gt +** ret +*/ +/* +** f4: +** adds (w[0-9]+), w0, #3 +** csinv w0, \1, wzr, ge +** ret +*/ + +#ifndef TYPE +#define TYPE int32_t +#define TYPE_MIN INT32_MIN +#define TYPE_MAX INT32_MAX +#define VALUE -4 +#endif + +#include <stdint.h> + +TYPE __attribute__((noipa)) +f1 (TYPE x) +{ + return (x > VALUE ? x - VALUE : 0); +} + +TYPE __attribute__((noipa)) +f2 (TYPE x) +{ + return (x > VALUE ? x : VALUE) - VALUE; +} + +TYPE __attribute__((noipa)) +f3 (TYPE x) +{ + return (x > VALUE ? x : VALUE) - (VALUE - 1); +} + +TYPE __attribute__((noipa)) +f4 (TYPE x) +{ + return (x > VALUE ? x : VALUE) - (VALUE + 1); +} + +TYPE __attribute__((noipa)) +f5 (TYPE x) +{ + return (x > VALUE ? x : VALUE) - (VALUE + 2); +} + +TYPE __attribute__((noipa)) +f6 (TYPE x) +{ + return (x > VALUE ? x : VALUE) - (VALUE - 2); +} + +int +main (void) +{ + TYPE max_test = TYPE_MAX; + if (TYPE_MIN < 0 && VALUE < 0) + max_test += VALUE; + + if (f1 (TYPE_MIN) != 0) + __builtin_abort (); + if (f1 (VALUE - 1) != 0) + __builtin_abort (); + if (f1 (VALUE) != 0) + __builtin_abort (); + if (f1 (VALUE + 1) != 1) + __builtin_abort (); + if (f1 (max_test) != max_test - VALUE) + __builtin_abort (); + + if (f2 (TYPE_MIN) != 0) + __builtin_abort (); + if (f2 (VALUE - 1) != 0) + __builtin_abort (); + if (f2 (VALUE) != 0) + __builtin_abort (); + if (f2 (VALUE + 1) != 1) + __builtin_abort (); + if (f2 (max_test) != max_test - VALUE) + __builtin_abort (); + + if (f3 (TYPE_MIN) != 1) + __builtin_abort (); + if (f3 (VALUE - 1) != 1) + __builtin_abort (); + if (f3 (VALUE) != 1) + __builtin_abort (); + if (f3 (VALUE + 1) != 2) + __builtin_abort (); + if (f3 (max_test - 1) != max_test - VALUE) + __builtin_abort (); + + if (f4 (TYPE_MIN) != -1) + __builtin_abort (); + if (f4 (VALUE - 1) != -1) + __builtin_abort (); + if (f4 (VALUE) != -1) + __builtin_abort (); + if (f4 (VALUE + 1) != 0) + __builtin_abort (); + if (f4 (max_test) != max_test - VALUE - 1) + __builtin_abort (); + + if (f5 (TYPE_MIN) != -2) + __builtin_abort (); + if (f5 (VALUE - 1) != -2) + __builtin_abort (); + if (f5 (VALUE) != -2) + __builtin_abort (); + if (f5 (VALUE + 1) != -1) + __builtin_abort (); + if (f5 (max_test) != max_test - VALUE - 2) + __builtin_abort (); + + if (f6 (TYPE_MIN) != 2) + __builtin_abort (); + if (f6 (VALUE - 1) != 2) + __builtin_abort (); + if (f6 (VALUE) != 2) + __builtin_abort (); + if (f6 (VALUE + 1) != 3) + __builtin_abort (); + if (VALUE <= max_test - 2 && f6 (max_test - 2) != max_test - VALUE) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/max_plus_2.c b/gcc/testsuite/gcc.target/aarch64/max_plus_2.c new file mode 100644 index 0000000..a2a1295 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/max_plus_2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** adds (x[0-9]+), x0, #4094 +** csel x0, \1, xzr, g[te] +** ret +*/ +/* +** f2: +** adds (x[0-9]+), x0, #4094 +** csel x0, \1, xzr, g[te] +** ret +*/ +/* +** f3: +** adds (x[0-9]+), x0, #4095 +** csinc x0, \1, xzr, gt +** ret +*/ +/* +** f4: +** adds (x[0-9]+), x0, #4093 +** csinv x0, \1, xzr, ge +** ret +*/ + +#define TYPE int64_t +#define TYPE_MIN INT64_MIN +#define TYPE_MAX INT64_MAX +#define VALUE -4094 + +#include "max_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/max_plus_3.c b/gcc/testsuite/gcc.target/aarch64/max_plus_3.c new file mode 100644 index 0000000..a9792ec --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/max_plus_3.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** adds (w[0-9]+), w0, #4095 +** csel w0, \1, wzr, g[te] +** ret +*/ +/* +** f2: +** adds (w[0-9]+), w0, #4095 +** csel w0, \1, wzr, g[te] +** ret +*/ +/* +** f3: +** adds (w[0-9]+), w0, #4096 +** csinc w0, \1, wzr, gt +** ret +*/ +/* +** f4: +** adds (w[0-9]+), w0, #4094 +** csinv w0, \1, wzr, ge +** ret +*/ + +#define TYPE int32_t +#define TYPE_MIN INT32_MIN +#define TYPE_MAX INT32_MAX +#define VALUE -4095 + +#include "max_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/max_plus_4.c b/gcc/testsuite/gcc.target/aarch64/max_plus_4.c new file mode 100644 index 0000000..5090fa1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/max_plus_4.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** adds (x[0-9]+), x0, #4096 +** csel x0, \1, xzr, g[te] +** ret +*/ +/* +** f2: +** adds (x[0-9]+), x0, #4096 +** csel x0, \1, xzr, g[te] +** ret +*/ +/* f3 out of range */ +/* +** f4: +** adds (x[0-9]+), x0, #4095 +** csinv x0, \1, xzr, ge +** ret +*/ + +#define TYPE int64_t +#define TYPE_MIN INT64_MIN +#define TYPE_MAX INT64_MAX +#define VALUE -4096 + +#include "max_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/max_plus_5.c b/gcc/testsuite/gcc.target/aarch64/max_plus_5.c new file mode 100644 index 0000000..63f3b34 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/max_plus_5.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** adds (w[0-9]+), w0, #4095 +** csel w0, \1, wzr, (cs|hi) +** ret +*/ +/* +** f2: +** adds (w[0-9]+), w0, #4095 +** csel w0, \1, wzr, (cs|hi) +** ret +*/ +/* +** f3: +** adds (w[0-9]+), w0, #4096 +** csinc w0, \1, wzr, hi +** ret +*/ +/* +** f4: +** adds (w[0-9]+), w0, #4094 +** csinv w0, \1, wzr, cs +** ret +*/ + +#define TYPE uint32_t +#define TYPE_MIN 0 +#define TYPE_MAX UINT32_MAX +#define VALUE (uint32_t)-4095 + +#include "max_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/max_plus_6.c b/gcc/testsuite/gcc.target/aarch64/max_plus_6.c new file mode 100644 index 0000000..ad592c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/max_plus_6.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ + +#define TYPE uint64_t +#define TYPE_MIN 0 +#define TYPE_MAX UINT64_MAX +#define VALUE (uint64_t)-2 + +#include "max_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/max_plus_7.c b/gcc/testsuite/gcc.target/aarch64/max_plus_7.c new file mode 100644 index 0000000..ac9f27d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/max_plus_7.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** adds (x[0-9]+), x0, #3 +** csel x0, \1, xzr, (cs|hi) +** ret +*/ +/* +** f2: +** adds (x[0-9]+), x0, #3 +** csel x0, \1, xzr, (cs|hi) +** ret +*/ +/* +** f3: +** adds (x[0-9]+), x0, #4 +** csinc x0, \1, xzr, hi +** ret +*/ +/* +** f4: +** adds (x[0-9]+), x0, #2 +** csinv x0, \1, xzr, cs +** ret +*/ + +#define TYPE uint64_t +#define TYPE_MIN 0 +#define TYPE_MAX UINT64_MAX +#define VALUE (uint64_t)-3 + +#include "max_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/min_plus_1.c b/gcc/testsuite/gcc.target/aarch64/min_plus_1.c new file mode 100644 index 0000000..f4c9106 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/min_plus_1.c @@ -0,0 +1,149 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** subs (w[0-9]+), w0, #?4 +** csel w0, \1, wzr, l[te] +** ret +*/ +/* +** f2: +** subs (w[0-9]+), w0, #?4 +** csel w0, \1, wzr, l[te] +** ret +*/ +/* +** f3: +** subs (w[0-9]+), w0, #?3 +** csinc w0, \1, wzr, le +** ret +*/ +/* +** f4: +** subs (w[0-9]+), w0, #?5 +** csinv w0, \1, wzr, lt +** ret +*/ + +#ifndef TYPE +#define TYPE int32_t +#define TYPE_MIN INT32_MIN +#define TYPE_MAX INT32_MAX +#define VALUE 4 +#endif + +#include <stdint.h> + +TYPE __attribute__((noipa)) +f1 (TYPE x) +{ + return (x < VALUE ? x - VALUE : 0); +} + +TYPE __attribute__((noipa)) +f2 (TYPE x) +{ + return (x < VALUE ? x : VALUE) - VALUE; +} + +TYPE __attribute__((noipa)) +f3 (TYPE x) +{ + return (x < VALUE ? x : VALUE) - (VALUE - 1); +} + +TYPE __attribute__((noipa)) +f4 (TYPE x) +{ + return (x < VALUE ? x : VALUE) - (VALUE + 1); +} + +TYPE __attribute__((noipa)) +f5 (TYPE x) +{ + return (x < VALUE ? x : VALUE) - (VALUE + 2); +} + +TYPE __attribute__((noipa)) +f6 (TYPE x) +{ + return (x < VALUE ? x : VALUE) - (VALUE - 2); +} + +int +main (void) +{ + TYPE min_test = TYPE_MIN; + if (TYPE_MIN < 0 && VALUE > 0) + min_test += VALUE; + + if (f1 (min_test) != min_test - VALUE) + __builtin_abort (); + if (f1 (VALUE - 1) != -1) + __builtin_abort (); + if (f1 (VALUE) != 0) + __builtin_abort (); + if (f1 (VALUE + 1) != 0) + __builtin_abort (); + if (f1 (TYPE_MAX) != 0) + __builtin_abort (); + + if (f2 (min_test) != min_test - VALUE) + __builtin_abort (); + if (f2 (VALUE - 1) != -1) + __builtin_abort (); + if (f2 (VALUE) != 0) + __builtin_abort (); + if (f2 (VALUE + 1) != 0) + __builtin_abort (); + if (f2 (TYPE_MAX) != 0) + __builtin_abort (); + + if (f3 (min_test) != min_test - VALUE + 1) + __builtin_abort (); + if (f3 (VALUE - 1) != 0) + __builtin_abort (); + if (f3 (VALUE) != 1) + __builtin_abort (); + if (f3 (VALUE + 1) != 1) + __builtin_abort (); + if (f3 (TYPE_MAX) != 1) + __builtin_abort (); + + if (f4 (min_test + 1) != min_test - VALUE) + __builtin_abort (); + if (f4 (VALUE - 1) != -2) + __builtin_abort (); + if (f4 (VALUE) != -1) + __builtin_abort (); + if (f4 (VALUE + 1) != -1) + __builtin_abort (); + if (f4 (TYPE_MAX) != -1) + __builtin_abort (); + + if (VALUE >= min_test + 2 && f5 (min_test + 2) != min_test - VALUE) + __builtin_abort (); + if (f5 (VALUE - 1) != -3) + __builtin_abort (); + if (f5 (VALUE) != -2) + __builtin_abort (); + if (f5 (VALUE + 1) != -2) + __builtin_abort (); + if (f5 (TYPE_MAX) != -2) + __builtin_abort (); + + if (f6 (min_test) != min_test - VALUE + 2) + __builtin_abort (); + if (f6 (VALUE - 1) != 1) + __builtin_abort (); + if (f6 (VALUE) != 2) + __builtin_abort (); + if (f6 (VALUE + 1) != 2) + __builtin_abort (); + if (f6 (TYPE_MAX) != 2) + __builtin_abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/min_plus_2.c b/gcc/testsuite/gcc.target/aarch64/min_plus_2.c new file mode 100644 index 0000000..bc0141b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/min_plus_2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** subs (x[0-9]+), x0, #?4094 +** csel x0, \1, xzr, l[te] +** ret +*/ +/* +** f2: +** subs (x[0-9]+), x0, #?4094 +** csel x0, \1, xzr, l[te] +** ret +*/ +/* +** f3: +** subs (x[0-9]+), x0, #?4093 +** csinc x0, \1, xzr, le +** ret +*/ +/* +** f4: +** subs (x[0-9]+), x0, #?4095 +** csinv x0, \1, xzr, lt +** ret +*/ + +#define TYPE int64_t +#define TYPE_MIN INT64_MIN +#define TYPE_MAX INT64_MAX +#define VALUE 4094 + +#include "min_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/min_plus_3.c b/gcc/testsuite/gcc.target/aarch64/min_plus_3.c new file mode 100644 index 0000000..1808e4b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/min_plus_3.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** subs (w[0-9]+), w0, #?4095 +** csel w0, \1, wzr, l[te] +** ret +*/ +/* +** f2: +** subs (w[0-9]+), w0, #?4095 +** csel w0, \1, wzr, l[te] +** ret +*/ +/* +** f3: +** subs (w[0-9]+), w0, #?4094 +** csinc w0, \1, wzr, le +** ret +*/ +/* +** f4: +** subs (w[0-9]+), w0, #?4096 +** csinv w0, \1, wzr, lt +** ret +*/ + +#define TYPE int32_t +#define TYPE_MIN INT32_MIN +#define TYPE_MAX INT32_MAX +#define VALUE 4095 + +#include "min_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/min_plus_4.c b/gcc/testsuite/gcc.target/aarch64/min_plus_4.c new file mode 100644 index 0000000..6c581fed --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/min_plus_4.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** subs (x[0-9]+), x0, #?4096 +** csel x0, \1, xzr, l[te] +** ret +*/ +/* +** f2: +** subs (x[0-9]+), x0, #?4096 +** csel x0, \1, xzr, l[te] +** ret +*/ +/* +** f3: +** subs (x[0-9]+), x0, #?4095 +** csinc x0, \1, xzr, le +** ret +*/ +/* f4 out of range */ + +#define TYPE int64_t +#define TYPE_MIN INT64_MIN +#define TYPE_MAX INT64_MAX +#define VALUE 4096 + +#include "min_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/min_plus_5.c b/gcc/testsuite/gcc.target/aarch64/min_plus_5.c new file mode 100644 index 0000000..97542d5 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/min_plus_5.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** subs (w[0-9]+), w0, #?4095 +** csel w0, \1, wzr, (cc|ls) +** ret +*/ +/* +** f2: +** subs (w[0-9]+), w0, #?4095 +** csel w0, \1, wzr, (cc|ls) +** ret +*/ +/* +** f3: +** subs (w[0-9]+), w0, #?4094 +** csinc w0, \1, wzr, ls +** ret +*/ +/* +** f4: +** subs (w[0-9]+), w0, #?4096 +** csinv w0, \1, wzr, cc +** ret +*/ + +#define TYPE uint32_t +#define TYPE_MIN 0 +#define TYPE_MAX UINT32_MAX +#define VALUE 4095 + +#include "min_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/min_plus_6.c b/gcc/testsuite/gcc.target/aarch64/min_plus_6.c new file mode 100644 index 0000000..176533c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/min_plus_6.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ + +#define TYPE uint64_t +#define TYPE_MIN 0 +#define TYPE_MAX UINT64_MAX +#define VALUE 1 + +#include "min_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/min_plus_7.c b/gcc/testsuite/gcc.target/aarch64/min_plus_7.c new file mode 100644 index 0000000..d6a217a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/min_plus_7.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 --save-temps" } */ +/* { dg-final { check-function-bodies "**" "" "" } } */ + +/* +** f1: +** subs (x[0-9]+), x0, #?2 +** csel x0, \1, xzr, (cc|ls) +** ret +*/ +/* +** f2: +** subs (x[0-9]+), x0, #?2 +** csel x0, \1, xzr, (cc|ls) +** ret +*/ +/* +** f3: +** subs (x[0-9]+), x0, #?1 +** csinc x0, \1, xzr, ls +** ret +*/ +/* +** f4: +** subs (x[0-9]+), x0, #?3 +** csinv x0, \1, xzr, cc +** ret +*/ + +#define TYPE uint64_t +#define TYPE_MIN 0 +#define TYPE_MAX UINT64_MAX +#define VALUE 2 + +#include "min_plus_1.c" diff --git a/gcc/testsuite/gcc.target/aarch64/pr100056.c b/gcc/testsuite/gcc.target/aarch64/pr100056.c index 0b77824..70499772 100644 --- a/gcc/testsuite/gcc.target/aarch64/pr100056.c +++ b/gcc/testsuite/gcc.target/aarch64/pr100056.c @@ -1,7 +1,9 @@ /* PR target/100056 */ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-not {\t[us]bfiz\tw[0-9]+, w[0-9]+, 11} } } */ +/* { dg-final { scan-assembler-not {\t[us]bfiz\tw[0-9]+, w[0-9]+, 11} { xfail *-*-* } } } */ +/* { dg-final { scan-assembler-times {\t[us]bfiz\tw[0-9]+, w[0-9]+, 11} 2 } } */ +/* { dg-final { scan-assembler-times {\tadd\tw[0-9]+, w[0-9]+, w[0-9]+, uxtb\n} 2 } } */ int or_shift_u8 (unsigned char i) diff --git a/gcc/testsuite/gcc.target/aarch64/shl-combine-2.c b/gcc/testsuite/gcc.target/aarch64/shl-combine-2.c index 6a0331f..491fd44 100644 --- a/gcc/testsuite/gcc.target/aarch64/shl-combine-2.c +++ b/gcc/testsuite/gcc.target/aarch64/shl-combine-2.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define TYPE char void e (signed TYPE * restrict a, signed TYPE *b, int n) diff --git a/gcc/testsuite/gcc.target/aarch64/shl-combine-3.c b/gcc/testsuite/gcc.target/aarch64/shl-combine-3.c index 2086b24a..39bef21 100644 --- a/gcc/testsuite/gcc.target/aarch64/shl-combine-3.c +++ b/gcc/testsuite/gcc.target/aarch64/shl-combine-3.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define TYPE short void e (signed TYPE * restrict a, signed TYPE *b, int n) diff --git a/gcc/testsuite/gcc.target/aarch64/shl-combine-4.c b/gcc/testsuite/gcc.target/aarch64/shl-combine-4.c index 0831810..15dcbff 100644 --- a/gcc/testsuite/gcc.target/aarch64/shl-combine-4.c +++ b/gcc/testsuite/gcc.target/aarch64/shl-combine-4.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define TYPE int void e (signed TYPE * restrict a, signed TYPE *b, int n) diff --git a/gcc/testsuite/gcc.target/aarch64/shl-combine-5.c b/gcc/testsuite/gcc.target/aarch64/shl-combine-5.c index 6b2a6bd..703f630 100644 --- a/gcc/testsuite/gcc.target/aarch64/shl-combine-5.c +++ b/gcc/testsuite/gcc.target/aarch64/shl-combine-5.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define TYPE long void e (signed TYPE * restrict a, signed TYPE *b, int n) diff --git a/gcc/testsuite/gcc.target/aarch64/store_v2vec_lanes.c b/gcc/testsuite/gcc.target/aarch64/store_v2vec_lanes.c index 3296d04..7ea8a67 100644 --- a/gcc/testsuite/gcc.target/aarch64/store_v2vec_lanes.c +++ b/gcc/testsuite/gcc.target/aarch64/store_v2vec_lanes.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -fno-tree-vectorize" } */ typedef long long v2di __attribute__ ((vector_size (16))); typedef double v2df __attribute__ ((vector_size (16))); diff --git a/gcc/testsuite/gcc.target/aarch64/xtn-combine-1.c b/gcc/testsuite/gcc.target/aarch64/xtn-combine-1.c index 14e0414..27b7858 100644 --- a/gcc/testsuite/gcc.target/aarch64/xtn-combine-1.c +++ b/gcc/testsuite/gcc.target/aarch64/xtn-combine-1.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define SIGN signed #define TYPE1 char #define TYPE2 short diff --git a/gcc/testsuite/gcc.target/aarch64/xtn-combine-2.c b/gcc/testsuite/gcc.target/aarch64/xtn-combine-2.c index c259010..02f03fa 100644 --- a/gcc/testsuite/gcc.target/aarch64/xtn-combine-2.c +++ b/gcc/testsuite/gcc.target/aarch64/xtn-combine-2.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define SIGN signed #define TYPE1 short #define TYPE2 int diff --git a/gcc/testsuite/gcc.target/aarch64/xtn-combine-3.c b/gcc/testsuite/gcc.target/aarch64/xtn-combine-3.c index 9a2065f..4bcbd85 100644 --- a/gcc/testsuite/gcc.target/aarch64/xtn-combine-3.c +++ b/gcc/testsuite/gcc.target/aarch64/xtn-combine-3.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define SIGN signed #define TYPE1 int #define TYPE2 long long diff --git a/gcc/testsuite/gcc.target/aarch64/xtn-combine-4.c b/gcc/testsuite/gcc.target/aarch64/xtn-combine-4.c index 77c3dce..29703d1 100644 --- a/gcc/testsuite/gcc.target/aarch64/xtn-combine-4.c +++ b/gcc/testsuite/gcc.target/aarch64/xtn-combine-4.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define SIGN unsigned #define TYPE1 char #define TYPE2 short diff --git a/gcc/testsuite/gcc.target/aarch64/xtn-combine-5.c b/gcc/testsuite/gcc.target/aarch64/xtn-combine-5.c index ae30e86..f5ee30d 100644 --- a/gcc/testsuite/gcc.target/aarch64/xtn-combine-5.c +++ b/gcc/testsuite/gcc.target/aarch64/xtn-combine-5.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define SIGN unsigned #define TYPE1 short #define TYPE2 int diff --git a/gcc/testsuite/gcc.target/aarch64/xtn-combine-6.c b/gcc/testsuite/gcc.target/aarch64/xtn-combine-6.c index 882f3d3..3ddb87e 100644 --- a/gcc/testsuite/gcc.target/aarch64/xtn-combine-6.c +++ b/gcc/testsuite/gcc.target/aarch64/xtn-combine-6.c @@ -1,6 +1,8 @@ /* { dg-do assemble } */ /* { dg-options "-O3 --save-temps --param=vect-epilogues-nomask=0" } */ +#pragma GCC target "+nosve" + #define SIGN unsigned #define TYPE1 int #define TYPE2 long long diff --git a/gcc/testsuite/gcc.target/i386/pr104448.c b/gcc/testsuite/gcc.target/i386/pr104448.c new file mode 100644 index 0000000..b10345a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr104448.c @@ -0,0 +1,9 @@ +/* PR target/104448 */ +/* { dg-do compile { target { *-*-linux* && lp64 } } } */ +/* { dg-options "-mavx5124vnniw -mno-xsave -mabi=ms" } */ + +int +main () +{ + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/htm-1.c b/gcc/testsuite/gcc.target/powerpc/htm-1.c index f27e32c..399a7ec 100644 --- a/gcc/testsuite/gcc.target/powerpc/htm-1.c +++ b/gcc/testsuite/gcc.target/powerpc/htm-1.c @@ -12,14 +12,21 @@ main (void) { long i; unsigned long mask = 0; + unsigned long retry_count = 0; repeat: if (__builtin_tbegin (0)) { mask++; + retry_count = 0; } else - abort(); + { + /* Retry a limited number of times before aborting. */ + if (retry_count++ < 10) + goto repeat; + abort (); + } if (mask == 1) { diff --git a/gcc/testsuite/gcc.target/powerpc/pr104253.c b/gcc/testsuite/gcc.target/powerpc/pr104253.c new file mode 100644 index 0000000..02049cc --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr104253.c @@ -0,0 +1,156 @@ +/* + * Require float128 support because __ibm128 currently is not enabled unless we + * also have __float128 support. We require software IEEE 128-bit support, + * which will work on power8. If we have hardware IEEE 128-bit support (power9 + * or power10), ppc_float128_sw will still enable running the test. + */ + +/* { dg-do run } */ +/* { require-effective-target ppc_float128_sw } */ +/* { dg-options "-O2 -mvsx -mfloat128" } */ + +/* + * PR target/104253 + * + * Verify that the various conversions to and from __ibm128 work. When the + * default for long double is changed to IEEE 128-bit, originally GCC would + * call the functions using an 'if' name instead of 'tf' name. + */ + +#include <stdlib.h> + +extern float ibm128_to_sf (__ibm128) __attribute__((noinline)); +extern double ibm128_to_df (__ibm128) __attribute__((noinline)); +extern int ibm128_to_si (__ibm128) __attribute__((noinline)); +extern long long ibm128_to_di (__ibm128) __attribute__((noinline)); +extern unsigned int ibm128_to_usi (__ibm128) __attribute__((noinline)); +extern unsigned long long ibm128_to_udi (__ibm128) __attribute__((noinline)); + +extern __ibm128 sf_to_ibm128 (float) __attribute__((noinline)); +extern __ibm128 df_to_ibm128 (double) __attribute__((noinline)); +extern __ibm128 si_to_ibm128 (int) __attribute__((noinline)); +extern __ibm128 di_to_ibm128 (long long) __attribute__((noinline)); +extern __ibm128 usi_to_ibm128 (unsigned int) __attribute__((noinline)); +extern __ibm128 udi_to_ibm128 (unsigned long long) __attribute__((noinline)); + +float +ibm128_to_sf (__ibm128 x) +{ + return x; +} + +double +ibm128_to_df (__ibm128 x) +{ + return x; +} + +int +ibm128_to_si (__ibm128 x) +{ + return x; +} + +long long +ibm128_to_di (__ibm128 x) +{ + return x; +} + +unsigned int +ibm128_to_usi (__ibm128 x) +{ + return x; +} + +unsigned long long +ibm128_to_udi (__ibm128 x) +{ + return x; +} + +__ibm128 +sf_to_ibm128 (float x) +{ + return x; +} + +__ibm128 +df_to_ibm128 (double x) +{ + return x; +} + +__ibm128 +si_to_ibm128 (int x) +{ + return x; +} + +__ibm128 +di_to_ibm128 (long long x) +{ + return x; +} + +__ibm128 +usi_to_ibm128 (unsigned int x) +{ + return x; +} + +__ibm128 +udi_to_ibm128 (unsigned long long x) +{ + return x; +} + +volatile float seven_sf = 7.0f; +volatile double seven_df = 7.0; +volatile int seven_si = 7; +volatile long long seven_di = 7LL; +volatile unsigned int seven_usi = 7U; +volatile unsigned long long seven_udi = 7ULL; +volatile __ibm128 seven_ibm128 = 7.0; + +int +main (void) +{ + if (seven_ibm128 != sf_to_ibm128 (seven_sf)) + abort (); + + if (seven_ibm128 != df_to_ibm128 (seven_df)) + abort (); + + if (seven_ibm128 != si_to_ibm128 (seven_si)) + abort (); + + if (seven_ibm128 != di_to_ibm128 (seven_di)) + abort (); + + if (seven_ibm128 != usi_to_ibm128 (seven_usi)) + abort (); + + if (seven_ibm128 != udi_to_ibm128 (seven_udi)) + abort (); + + if (seven_sf != ibm128_to_sf (seven_ibm128)) + abort (); + + if (seven_df != ibm128_to_df (seven_ibm128)) + abort (); + + if (seven_si != ibm128_to_si (seven_ibm128)) + abort (); + + if (seven_di != ibm128_to_di (seven_ibm128)) + abort (); + + if (seven_usi != ibm128_to_usi (seven_ibm128)) + abort (); + + if (seven_udi != ibm128_to_udi (seven_ibm128)) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gdc.test/compilable/casttuple.d b/gcc/testsuite/gdc.test/compilable/casttuple.d new file mode 100644 index 0000000..c4c2bc8 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/casttuple.d @@ -0,0 +1,31 @@ +alias tuple(T...) = T; + +void exactMatch() +{ + tuple!int tup_1; + + auto i = cast() tup_1; + static assert(is(typeof(i) == int)); + const i_const = cast(const) tup_1; + static assert(is(typeof(i_const) == const int)); + + auto totup_1 = cast(tuple!int) tup_1; + static assert(is(typeof(totup_1) == tuple!int)); + + tuple!(int, int) tup_2; + auto totup_2 = cast(tuple!(int, int)) tup_2; + static assert(is(typeof(totup_2) == tuple!(int, int))); +} + +void implicitConv() +{ + tuple!short tup_1; + auto totup_1 = cast(tuple!int) tup_1; + static assert(is(typeof(tup_1) == tuple!short)); + static assert(is(typeof(totup_1) == tuple!int)); + + tuple!(short, short) tup_2; + auto totup_2 = cast(tuple!(int, int)) tup_2; + static assert(is(typeof(tup_2) == tuple!(short, short))); + static assert(is(typeof(totup_2) == tuple!(int, int))); +} diff --git a/gcc/testsuite/gdc.test/compilable/deprecated_override.d b/gcc/testsuite/gdc.test/compilable/deprecated_override.d new file mode 100644 index 0000000..c9da34d --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/deprecated_override.d @@ -0,0 +1,97 @@ +// https://issues.dlang.org/show_bug.cgi?id=22668 + +// Overrides with same deprecated'ness are allowed + +class SameParent +{ + deprecated void foo() {} + void foo(int) {} + + void bar(int) {} + deprecated void bar() {} +} + +class SameChild : SameParent +{ + deprecated override void foo() {} + override void foo(int) {} + + override void bar(int) {} + deprecated override void bar() {} +} + +/** +Only the parent declaration is deprecated + +TEST_OUTPUT: +---- +compilable/deprecated_override.d(44): Deprecation: `deprecated_override.IntroducingChild.foo` is overriding the deprecated method `deprecated_override.IntroducingParent.foo` +compilable/deprecated_override.d(48): Deprecation: `deprecated_override.IntroducingChild.bar` is overriding the deprecated method `deprecated_override.IntroducingParent.bar` +---- +**/ + +class IntroducingParent +{ + deprecated void foo() {} + void foo(int) {} + + void bar(int) {} + deprecated void bar() {} +} + +class IntroducingChild : IntroducingParent +{ + override void foo() {} + override void foo(int) {} + + override void bar(int) {} + override void bar() {} +} + +// Unrelated to this path but should this error as well? + +class IntroducingGrandchild : IntroducingChild +{ + override void foo() {} + override void foo(int) {} + + override void bar(int) {} + override void bar() {} +} + +/** +Only the overriding declaration is deprecated + +TEST_OUTPUT: +---- +compilable/deprecated_override.d(83): Deprecation: `deprecated_override.OverrideChild.foo` cannot be marked as `deprecated` because it is overriding a function in the base class +compilable/deprecated_override.d(87): Deprecation: `deprecated_override.OverrideChild.bar` cannot be marked as `deprecated` because it is overriding a function in the base class +---- +**/ + +class OverrideParent +{ + void foo() {} + void foo(int) {} + + void bar(int) {} + void bar() {} +} + +class OverrideChild : OverrideParent +{ + deprecated override void foo() {} + override void foo(int) {} + + override void bar(int) {} + deprecated override void bar() {} +} + +class OverrideGrandChild : OverrideChild +{ + deprecated override void foo() {} + override void foo(int) {} + + override void bar(int) {} + deprecated override void bar() {} +} diff --git a/gcc/testsuite/gdc.test/compilable/extra-files/header1.d b/gcc/testsuite/gdc.test/compilable/extra-files/header1.d index 209d4a0..01cf889 100644 --- a/gcc/testsuite/gdc.test/compilable/extra-files/header1.d +++ b/gcc/testsuite/gdc.test/compilable/extra-files/header1.d @@ -600,3 +600,9 @@ struct Test14UDA4(string v){} void test14x(@Test14UDA1 int, @Test14UDA2("1") int, @test14uda3("2") int, @Test14UDA4!"3" int) {} void test15x(@(20) void delegate(int) @safe dg){} + +T throwStuff(T)(T t) +{ + if (false) test13x(1, throw new Exception(""), 2); + return t ? t : throw new Exception("Bad stuff happens!"); +} diff --git a/gcc/testsuite/gdc.test/compilable/fix17635.d b/gcc/testsuite/gdc.test/compilable/fix17635.d new file mode 100644 index 0000000..dd14de1 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/fix17635.d @@ -0,0 +1,16 @@ +// https://issues.dlang.org/show_bug.cgi?id=17635 + +alias T = immutable int; + +T** f(const T** input) pure +{ + T** output; + return output; +} + +void main() +{ + T i; + T* p = &i; + immutable T** r = f(&p); +} diff --git a/gcc/testsuite/gdc.test/compilable/fix22291.d b/gcc/testsuite/gdc.test/compilable/fix22291.d new file mode 100644 index 0000000..4090c5e --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/fix22291.d @@ -0,0 +1,134 @@ +//https://issues.dlang.org/show_bug.cgi?id=22291 + +alias AliasSeq(T...) = T; +void noParameters() +{ + static assert(typeof(__traits(parameters)).length == 0); +} +void noArgs() +{ + //Arguments are not valid, this should not compile + static assert(!__traits(compiles, __traits(parameters, 456))); +} +shared static this() +{ + static assert(typeof(__traits(parameters)).length == 0); +} +int echoPlusOne(int x) +{ + __traits(parameters)[0] += 1; + return x; +} +static assert(echoPlusOne(1) == 2); +class Tree { + int opApply(int delegate(size_t, Tree) dg) { + if (dg(0, this)) return 1; + return 0; + } +} +void useOpApply(Tree top, int x) +{ + foreach(idx; 0..5) + { + static assert(is(typeof(__traits(parameters)) == AliasSeq!(Tree, int))); + } + foreach(idx, elem; top) + { + static assert(is(typeof(__traits(parameters)) == AliasSeq!(size_t, Tree))); + } +} +class Test +{ + static assert(!__traits(compiles, __traits(parameters))); + void handle(int x) + { + static assert(typeof(__traits(parameters)).length == 1); + } +} + +int add(int x, int y) +{ + return x + y; +} + +auto forwardToAdd(int x, int y) +{ + return add(__traits(parameters)); +} +static assert(forwardToAdd(2, 3) == 5); +struct TestConstructor +{ + int x; + string y; + //This parameter will not have a name but it's (tuple) members + //will + this(typeof(this.tupleof)) + { + this.tupleof = __traits(parameters); + } +} +bool test(int x, string y) +{ + auto s = TestConstructor(2, "pi"); + return s.x == x && s.y == y; +} +static assert(test(2, "pi")); +int testNested(int x) +{ + static assert(typeof(__traits(parameters)).length == 1); + int add(int x, int y) + { + static assert(typeof(__traits(parameters)).length == 2); + return x + y; + } + return add(x + 2, x + 3); +} +void testPack(Pack...)(Pack x) +{ + static assert(is(typeof(__traits(parameters)) == typeof(AliasSeq!(x)))); +} + +ref int forwardTest(return ref int x) +{ + static assert(__traits(isRef, x) == __traits(isRef, __traits(parameters)[0])); + return x; +} + +int testRefness(int x, ref int monkey) +{ + { + //monkey = x; + __traits(parameters)[1] = __traits(parameters)[0]; + } + return x; +} +int refTest() +{ + int x; + testRefness(45, x); + return x; +} +auto packLength(Pack...)(Pack x) +{ + return typeof(__traits(parameters)).length; +} +static assert(packLength(2, 3) == 2); +alias lambda = (x) => typeof(__traits(parameters)).stringof; +static assert(lambda(1) == "(int)"); +static assert(refTest() == 45); + +T testTemplate(T)(scope T input) +{ + void chimpInASuit(float set) + { + static assert(is(typeof(__traits(parameters)) == AliasSeq!(float))); + } + { + __traits(parameters) = AliasSeq!(T.max); + } + __traits(parameters) = AliasSeq!(T.init); + return input; +} + +static assert(testTemplate!long(420) == 0); + diff --git a/gcc/testsuite/gdc.test/compilable/imports/cstuff3.c b/gcc/testsuite/gdc.test/compilable/imports/cstuff3.c new file mode 100644 index 0000000..f6aaf3b --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/imports/cstuff3.c @@ -0,0 +1,6 @@ +// check bugs in importing C files + +int squared(int a) +{ + return a * a; +} diff --git a/gcc/testsuite/gdc.test/compilable/imports/imp22625.c b/gcc/testsuite/gdc.test/compilable/imports/imp22625.c new file mode 100644 index 0000000..0d18459 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/imports/imp22625.c @@ -0,0 +1 @@ +typedef struct S { int x; } T; diff --git a/gcc/testsuite/gdc.test/compilable/imports/imp22665.c b/gcc/testsuite/gdc.test/compilable/imports/imp22665.c new file mode 100644 index 0000000..f575cff --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/imports/imp22665.c @@ -0,0 +1 @@ +enum E { A }; diff --git a/gcc/testsuite/gdc.test/compilable/imports/test22685b.d b/gcc/testsuite/gdc.test/compilable/imports/test22685b.d new file mode 100644 index 0000000..e1854d1 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/imports/test22685b.d @@ -0,0 +1,5 @@ +module imports.test22685b; + +import imports.test22685c : overloaded; + +void overloaded()() { } diff --git a/gcc/testsuite/gdc.test/compilable/imports/test22685c.d b/gcc/testsuite/gdc.test/compilable/imports/test22685c.d new file mode 100644 index 0000000..e2c8ad1 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/imports/test22685c.d @@ -0,0 +1,3 @@ +module imports.test22685c; + +void overloaded()() { } diff --git a/gcc/testsuite/gdc.test/compilable/issue22130.d b/gcc/testsuite/gdc.test/compilable/issue22130.d new file mode 100644 index 0000000..34a631d --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/issue22130.d @@ -0,0 +1,12 @@ +// https://issues.dlang.org/show_bug.cgi?id=22130 + +int* f(const int* input) pure nothrow @safe +{ + int* output; + return output; +} +void main() pure nothrow @safe +{ + int* c = new int; + immutable int* i = f(c); +} diff --git a/gcc/testsuite/gdc.test/compilable/noreturn1.d b/gcc/testsuite/gdc.test/compilable/noreturn1.d index 22734cf..5bba9ba 100644 --- a/gcc/testsuite/gdc.test/compilable/noreturn1.d +++ b/gcc/testsuite/gdc.test/compilable/noreturn1.d @@ -20,8 +20,7 @@ static assert(!is(noreturn == void)); static assert(is( typeof(assert(0)) == noreturn )); -// Does not parse yet -// static assert(is( typeof(throw new Exception()) == noreturn )); +static assert(is( typeof(throw new Exception("")) == noreturn )); static assert(is(noreturn == noreturn)); static assert(!is(noreturn == const noreturn)); diff --git a/gcc/testsuite/gdc.test/compilable/test13008.d b/gcc/testsuite/gdc.test/compilable/test13008.d index fd1f41d..f19fdb7 100644 --- a/gcc/testsuite/gdc.test/compilable/test13008.d +++ b/gcc/testsuite/gdc.test/compilable/test13008.d @@ -1,10 +1,6 @@ // REQUIRED_ARGS: -o- // PERMUTE_ARGS: -d -de -dw -/* -TEST_OUTPUT* ---- ---- -*/ + deprecated class Dep { } deprecated Dep depFunc1(); // error deprecated void depFunc2(Dep); // error diff --git a/gcc/testsuite/gdc.test/compilable/test18771.d b/gcc/testsuite/gdc.test/compilable/test18771.d index a71361f..e6a511c 100644 --- a/gcc/testsuite/gdc.test/compilable/test18771.d +++ b/gcc/testsuite/gdc.test/compilable/test18771.d @@ -1,4 +1,4 @@ -// REQUIRED_ARGS : -c +// REQUIRED_ARGS: -c // EXTRA_FILES: imports/test18771a.d imports/test18771b.d imports/test18771c.d imports/test18771d.d // https://issues.dlang.org/show_bug.cgi?id=18771 diff --git a/gcc/testsuite/gdc.test/compilable/test19609.d b/gcc/testsuite/gdc.test/compilable/test19609.d index 2646bd4..4367df1 100644 --- a/gcc/testsuite/gdc.test/compilable/test19609.d +++ b/gcc/testsuite/gdc.test/compilable/test19609.d @@ -1,7 +1,7 @@ // https://issues.dlang.org/show_bug.cgi?id=19609 // EXTRA_FILES: imports/test19609a.d imports/test19609b.d imports/test19609c.d /* -TEST_OUTPUT +TEST_OUTPUT: --- compilable/test19609.d(11): Deprecation: module `imports.test19609a` is deprecated - compilable/test19609.d(12): Deprecation: module `imports.test19609b` is deprecated - hello diff --git a/gcc/testsuite/gdc.test/compilable/test19873.d b/gcc/testsuite/gdc.test/compilable/test19873.d index 7252edd..e69b4df 100644 --- a/gcc/testsuite/gdc.test/compilable/test19873.d +++ b/gcc/testsuite/gdc.test/compilable/test19873.d @@ -1,4 +1,4 @@ -// PERMUTE_ARGS -preview=dip1000 +// PERMUTE_ARGS: -preview=dip1000 // https://issues.dlang.org/show_bug.cgi?id=19873 int* ed(scope int* x) { diff --git a/gcc/testsuite/gdc.test/compilable/test21299a.d b/gcc/testsuite/gdc.test/compilable/test21299a.d index 3c6d8ec..12cc579 100644 --- a/gcc/testsuite/gdc.test/compilable/test21299a.d +++ b/gcc/testsuite/gdc.test/compilable/test21299a.d @@ -1,4 +1,4 @@ // EXTRA_SOURCES: imports/test21299/mtype.d imports/test21299/func.d imports/test21299/rootstringtable.d // REQUIRED_ARGS: -main -// LINK +// LINK: module test21299a; diff --git a/gcc/testsuite/gdc.test/compilable/test22619.d b/gcc/testsuite/gdc.test/compilable/test22619.d new file mode 100644 index 0000000..fd5e894 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test22619.d @@ -0,0 +1,11 @@ +// https://issues.dlang.org/show_bug.cgi?id=22619 + +struct W1 { + int x; + this(ref inout W1 rhs) inout { this.x = rhs.x; } +} + +inout(W1) f(inout W1 x) { return x; } +void g(W1 x) { + auto r = f(x); +} diff --git a/gcc/testsuite/gdc.test/compilable/test22625.d b/gcc/testsuite/gdc.test/compilable/test22625.d new file mode 100644 index 0000000..adf6676 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test22625.d @@ -0,0 +1,4 @@ +// https://issues.dlang.org/show_bug.cgi?id=22625 +// EXTRA_FILES: imports/imp22625.c + +import imports.imp22625 : S, T; diff --git a/gcc/testsuite/gdc.test/compilable/test22646.d b/gcc/testsuite/gdc.test/compilable/test22646.d new file mode 100644 index 0000000..ae44d81 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test22646.d @@ -0,0 +1,21 @@ +// https://issues.dlang.org/show_bug.cgi?id=22646 + +/* +TEST_OUTPUT: +--- +true +true +false +false +--- +*/ + +static template Bug(string name) +{ + enum bool ok = name.length < 3 || name[0..3] != "pad"; +} + +pragma(msg, Bug!"x".ok); +pragma(msg, Bug!"foo".ok); +pragma(msg, Bug!"pad".ok); +pragma(msg, Bug!"pad123".ok); diff --git a/gcc/testsuite/gdc.test/compilable/test22665.d b/gcc/testsuite/gdc.test/compilable/test22665.d new file mode 100644 index 0000000..9d55dbb --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test22665.d @@ -0,0 +1,22 @@ +// EXTRA_FILES: imports/imp22665.c + +// https://issues.dlang.org/show_bug.cgi?id=22665 + +import imports.imp22665; + +E foo1(E e) +{ + return e.A; // with qualification, it is an enum +} + +int foo2() +{ + return A; // without qualification, it is an int +} + +E foo3(E e) +{ + return E.A; // with qualification, it is an enum +} + + diff --git a/gcc/testsuite/gdc.test/compilable/test22676.d b/gcc/testsuite/gdc.test/compilable/test22676.d new file mode 100644 index 0000000..8adc132 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test22676.d @@ -0,0 +1,25 @@ +// https://issues.dlang.org/show_bug.cgi?id=22676 +template fullyQualifiedName(T) +{ + static if (is(T : real)) + enum fullyQualifiedName; + + enum fullyQualifiedName = null; +} + +static auto _inst() +{ + return fullyQualifiedName!(frop); +} + +alias attr = __traits(getAttributes, _inst); + +class frop +{ + alias type_id = registry!frop; +} + +template registry(T) +{ + enum string FOO = fullyQualifiedName!T; +} diff --git a/gcc/testsuite/gdc.test/compilable/test22685.d b/gcc/testsuite/gdc.test/compilable/test22685.d new file mode 100644 index 0000000..504cc9d --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test22685.d @@ -0,0 +1,11 @@ +// EXTRA_FILES: imports/test22685b.d imports/test22685c.d + +module test22685; + +import imports.test22685b; + +void twoArgs(alias a, alias b)() { } + +void main() { + twoArgs!(a => 1, overloaded); +} diff --git a/gcc/testsuite/gdc.test/compilable/test55.d b/gcc/testsuite/gdc.test/compilable/test55.d index 6dfc665..4b413e1 100644 --- a/gcc/testsuite/gdc.test/compilable/test55.d +++ b/gcc/testsuite/gdc.test/compilable/test55.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // COMPILED_IMPORTS: imports/test55a.d // PERMUTE_ARGS: -dw // REQUIRED_ARGS: -d @@ -17,4 +17,3 @@ class Queue2 { alias int ListHead; Arm2 a; } - diff --git a/gcc/testsuite/gdc.test/compilable/testcstuff3.d b/gcc/testsuite/gdc.test/compilable/testcstuff3.d new file mode 100644 index 0000000..89228a9 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/testcstuff3.d @@ -0,0 +1,4 @@ +// EXTRA_FILES: imports/cstuff3.c +import imports.cstuff3; + +static assert(squared(4) == 16); diff --git a/gcc/testsuite/gdc.test/compilable/testos.d b/gcc/testsuite/gdc.test/compilable/testos.d new file mode 100644 index 0000000..e0eb3a5 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/testos.d @@ -0,0 +1,7 @@ +/* PERMUTE_ARGS: -os=host -os=linux -os=osx -os=freebsd -os=solaris + * DISABLED: win32 win64 + */ + +void test() +{ +} diff --git a/gcc/testsuite/gdc.test/compilable/b16967.d b/gcc/testsuite/gdc.test/fail_compilation/b16967.d index 57bc1c1..7a2c3e4 100644 --- a/gcc/testsuite/gdc.test/compilable/b16967.d +++ b/gcc/testsuite/gdc.test/fail_compilation/b16967.d @@ -1,9 +1,8 @@ /* - * REQUIRED_ARGS: -c * TEST_OUTPUT: --- -compilable/b16967.d(16): Deprecation: switch case fallthrough - use 'goto default;' if intended -compilable/b16967.d(26): Deprecation: switch case fallthrough - use 'goto default;' if intended +fail_compilation/b16967.d(15): Error: switch case fallthrough - use 'goto default;' if intended +fail_compilation/b16967.d(25): Error: switch case fallthrough - use 'goto default;' if intended --- */ int foo(int x) diff --git a/gcc/testsuite/gdc.test/fail_compilation/bug5096.d b/gcc/testsuite/gdc.test/fail_compilation/bug5096.d new file mode 100644 index 0000000..2063e41 --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/bug5096.d @@ -0,0 +1,14 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/bug5096.d(13): Error: unmatched closing brace +--- +*/ +void foo(int x) + in { + assert(x > 0); + } do { + x++; + } +} +void main() {} diff --git a/gcc/testsuite/gdc.test/fail_compilation/bug9631.d b/gcc/testsuite/gdc.test/fail_compilation/bug9631.d index 33ea0cd..0edd5e9 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/bug9631.d +++ b/gcc/testsuite/gdc.test/fail_compilation/bug9631.d @@ -91,9 +91,9 @@ TEST_OUTPUT: --- fail_compilation/bug9631.d(106): Error: function `bug9631.targ.ft!().ft(S _param_0)` is not callable using argument types `(S)` fail_compilation/bug9631.d(106): cannot pass argument `x` of type `bug9631.S` to parameter `bug9631.tem!().S _param_0` -fail_compilation/bug9631.d(107): Error: template `bug9631.targ.ft` cannot deduce function from argument types `!()(S)` +fail_compilation/bug9631.d(107): Error: none of the overloads of template `bug9631.targ.ft` are callable using argument types `!()(S)` fail_compilation/bug9631.d(105): Candidate is: `ft()(tem!().S)` -fail_compilation/bug9631.d(109): Error: template `bug9631.targ.ft2` cannot deduce function from argument types `!()(S, int)` +fail_compilation/bug9631.d(109): Error: none of the overloads of template `bug9631.targ.ft2` are callable using argument types `!()(S, int)` fail_compilation/bug9631.d(108): Candidate is: `ft2(T)(S, T)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/casttuple.d b/gcc/testsuite/gdc.test/fail_compilation/casttuple.d new file mode 100644 index 0000000..d08de08b5 --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/casttuple.d @@ -0,0 +1,25 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/casttuple.d(104): Error: cannot cast `__tup1_field_0` of type `int` to tuple type `(string)` +fail_compilation/casttuple.d(107): Error: cannot cast `tuple(__tup2_field_0, __tup2_field_1)` of type `(int, int)` to tuple type `(string, string)` +fail_compilation/casttuple.d(111): Error: cannot cast `tuple(foo, 123)` of type `(int, int)` to tuple type `(string, string)` +--- + */ + +alias tuple(T...) = T; + +#line 100 + +void nomatch() +{ + tuple!int tup1; + auto x = cast(tuple!string) tup1; + + tuple!(int, int) tup2; + auto y = cast(tuple!(string, string)) tup2; + + int foo; + alias tup3 = tuple!(foo, 123); + auto z = cast(tuple!(string, string)) tup3; +} diff --git a/gcc/testsuite/gdc.test/fail_compilation/constraints_aggr.d b/gcc/testsuite/gdc.test/fail_compilation/constraints_aggr.d index a60ea8c..9f12ae6 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/constraints_aggr.d +++ b/gcc/testsuite/gdc.test/fail_compilation/constraints_aggr.d @@ -2,12 +2,12 @@ EXTRA_FILES: imports/constraints.d TEST_OUTPUT: --- -fail_compilation/constraints_aggr.d(32): Error: template `imports.constraints.C.f` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_aggr.d(32): Error: none of the overloads of template `imports.constraints.C.f` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(60): Candidate is: `f(T)(T v)` with `T = int` must satisfy the following constraint: ` !P!T` -fail_compilation/constraints_aggr.d(33): Error: template `imports.constraints.C.g` cannot deduce function from argument types `!()()` +fail_compilation/constraints_aggr.d(33): Error: none of the overloads of template `imports.constraints.C.g` are callable using argument types `!()()` fail_compilation/imports/constraints.d(63): Candidate is: `g(this T)()` with `T = imports.constraints.C` must satisfy the following constraint: diff --git a/gcc/testsuite/gdc.test/fail_compilation/constraints_func1.d b/gcc/testsuite/gdc.test/fail_compilation/constraints_func1.d index 91dd405..aac8760 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/constraints_func1.d +++ b/gcc/testsuite/gdc.test/fail_compilation/constraints_func1.d @@ -2,72 +2,72 @@ EXTRA_FILES: imports/constraints.d TEST_OUTPUT: --- -fail_compilation/constraints_func1.d(79): Error: template `imports.constraints.test1` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(79): Error: none of the overloads of template `imports.constraints.test1` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(9): Candidate is: `test1(T)(T v)` with `T = int` must satisfy the following constraint: ` N!T` -fail_compilation/constraints_func1.d(80): Error: template `imports.constraints.test2` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(80): Error: none of the overloads of template `imports.constraints.test2` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(10): Candidate is: `test2(T)(T v)` with `T = int` must satisfy the following constraint: ` !P!T` -fail_compilation/constraints_func1.d(81): Error: template `imports.constraints.test3` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(81): Error: none of the overloads of template `imports.constraints.test3` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(11): Candidate is: `test3(T)(T v)` with `T = int` must satisfy the following constraint: ` N!T` -fail_compilation/constraints_func1.d(82): Error: template `imports.constraints.test4` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(82): Error: none of the overloads of template `imports.constraints.test4` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(12): Candidate is: `test4(T)(T v)` with `T = int` must satisfy the following constraint: ` N!T` -fail_compilation/constraints_func1.d(83): Error: template `imports.constraints.test5` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(83): Error: none of the overloads of template `imports.constraints.test5` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(13): Candidate is: `test5(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T N!T` -fail_compilation/constraints_func1.d(84): Error: template `imports.constraints.test6` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(84): Error: none of the overloads of template `imports.constraints.test6` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(14): Candidate is: `test6(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T N!T !P!T` -fail_compilation/constraints_func1.d(85): Error: template `imports.constraints.test7` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(85): Error: none of the overloads of template `imports.constraints.test7` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(15): Candidate is: `test7(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T N!T` -fail_compilation/constraints_func1.d(86): Error: template `imports.constraints.test8` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(86): Error: none of the overloads of template `imports.constraints.test8` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(16): Candidate is: `test8(T)(T v)` with `T = int` must satisfy the following constraint: ` N!T` -fail_compilation/constraints_func1.d(87): Error: template `imports.constraints.test9` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(87): Error: none of the overloads of template `imports.constraints.test9` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(17): Candidate is: `test9(T)(T v)` with `T = int` must satisfy the following constraint: ` !P!T` -fail_compilation/constraints_func1.d(88): Error: template `imports.constraints.test10` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(88): Error: none of the overloads of template `imports.constraints.test10` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(18): Candidate is: `test10(T)(T v)` with `T = int` must satisfy the following constraint: ` !P!T` -fail_compilation/constraints_func1.d(89): Error: template `imports.constraints.test11` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(89): Error: none of the overloads of template `imports.constraints.test11` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(19): Candidate is: `test11(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T !P!T` -fail_compilation/constraints_func1.d(90): Error: template `imports.constraints.test12` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func1.d(90): Error: none of the overloads of template `imports.constraints.test12` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(20): Candidate is: `test12(T)(T v)` with `T = int` must satisfy the following constraint: ` !P!T` -fail_compilation/constraints_func1.d(92): Error: template `imports.constraints.test1` cannot deduce function from argument types `!()(int, int)` +fail_compilation/constraints_func1.d(92): Error: none of the overloads of template `imports.constraints.test1` are callable using argument types `!()(int, int)` fail_compilation/imports/constraints.d(9): Candidate is: `test1(T)(T v)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/constraints_func2.d b/gcc/testsuite/gdc.test/fail_compilation/constraints_func2.d index 67aa78c..a20426d 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/constraints_func2.d +++ b/gcc/testsuite/gdc.test/fail_compilation/constraints_func2.d @@ -2,83 +2,83 @@ EXTRA_FILES: imports/constraints.d TEST_OUTPUT: --- -fail_compilation/constraints_func2.d(94): Error: template `imports.constraints.test13` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(94): Error: none of the overloads of template `imports.constraints.test13` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(23): Candidate is: `test13(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T !P!T` -fail_compilation/constraints_func2.d(95): Error: template `imports.constraints.test14` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(95): Error: none of the overloads of template `imports.constraints.test14` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(24): Candidate is: `test14(T)(T v)` with `T = int` must satisfy one of the following constraints: ` !P!T N!T` -fail_compilation/constraints_func2.d(96): Error: template `imports.constraints.test15` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(96): Error: none of the overloads of template `imports.constraints.test15` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(25): Candidate is: `test15(T)(T v)` with `T = int` must satisfy one of the following constraints: ` !P!T !P!T` -fail_compilation/constraints_func2.d(97): Error: template `imports.constraints.test16` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(97): Error: none of the overloads of template `imports.constraints.test16` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(26): Candidate is: `test16(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T N!T` -fail_compilation/constraints_func2.d(98): Error: template `imports.constraints.test17` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(98): Error: none of the overloads of template `imports.constraints.test17` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(27): Candidate is: `test17(T)(T v)` with `T = int` must satisfy the following constraint: ` N!T` -fail_compilation/constraints_func2.d(99): Error: template `imports.constraints.test18` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(99): Error: none of the overloads of template `imports.constraints.test18` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(28): Candidate is: `test18(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T N!T` -fail_compilation/constraints_func2.d(100): Error: template `imports.constraints.test19` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(100): Error: none of the overloads of template `imports.constraints.test19` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(29): Candidate is: `test19(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T !P!T N!T` -fail_compilation/constraints_func2.d(101): Error: template `imports.constraints.test20` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(101): Error: none of the overloads of template `imports.constraints.test20` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(30): Candidate is: `test20(T)(T v)` with `T = int` must satisfy the following constraint: ` N!T` -fail_compilation/constraints_func2.d(102): Error: template `imports.constraints.test21` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(102): Error: none of the overloads of template `imports.constraints.test21` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(31): Candidate is: `test21(T)(T v)` with `T = int` must satisfy one of the following constraints: ` N!T N!T` -fail_compilation/constraints_func2.d(103): Error: template `imports.constraints.test22` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(103): Error: none of the overloads of template `imports.constraints.test22` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(32): Candidate is: `test22(T)(T v)` with `T = int` must satisfy one of the following constraints: ` !P!T !P!T` -fail_compilation/constraints_func2.d(104): Error: template `imports.constraints.test23` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(104): Error: none of the overloads of template `imports.constraints.test23` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(33): Candidate is: `test23(T)(T v)` with `T = int` must satisfy one of the following constraints: ` !P!T N!T !P!T` -fail_compilation/constraints_func2.d(105): Error: template `imports.constraints.test24` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(105): Error: none of the overloads of template `imports.constraints.test24` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(34): Candidate is: `test24(R)(R r)` with `R = int` must satisfy the following constraint: ` __traits(hasMember, R, "stuff")` -fail_compilation/constraints_func2.d(106): Error: template `imports.constraints.test25` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func2.d(106): Error: none of the overloads of template `imports.constraints.test25` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(35): Candidate is: `test25(T)(T v)` with `T = int` must satisfy the following constraint: ` N!T` -fail_compilation/constraints_func2.d(107): Error: template `imports.constraints.test26` cannot deduce function from argument types `!(float)(int)` +fail_compilation/constraints_func2.d(107): Error: none of the overloads of template `imports.constraints.test26` are callable using argument types `!(float)(int)` fail_compilation/imports/constraints.d(36): Candidate is: `test26(T, U)(U u)` with `T = float, U = int` diff --git a/gcc/testsuite/gdc.test/fail_compilation/constraints_func3.d b/gcc/testsuite/gdc.test/fail_compilation/constraints_func3.d index f0a5099..6f214b9 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/constraints_func3.d +++ b/gcc/testsuite/gdc.test/fail_compilation/constraints_func3.d @@ -2,7 +2,7 @@ EXTRA_FILES: imports/constraints.d TEST_OUTPUT: --- -fail_compilation/constraints_func3.d(53): Error: template `imports.constraints.overload` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func3.d(53): Error: none of the overloads of template `imports.constraints.overload` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(39): Candidates are: `overload(T)(T v)` with `T = int` must satisfy the following constraint: @@ -13,7 +13,7 @@ fail_compilation/imports/constraints.d(40): `overload(T)( ` !P!T` fail_compilation/imports/constraints.d(41): `overload(T)(T v1, T v2)` fail_compilation/imports/constraints.d(42): `overload(T, V)(T v1, V v2)` -fail_compilation/constraints_func3.d(54): Error: template `imports.constraints.overload` cannot deduce function from argument types `!()(int, string)` +fail_compilation/constraints_func3.d(54): Error: none of the overloads of template `imports.constraints.overload` are callable using argument types `!()(int, string)` fail_compilation/imports/constraints.d(39): Candidates are: `overload(T)(T v)` fail_compilation/imports/constraints.d(40): `overload(T)(T v)` fail_compilation/imports/constraints.d(41): `overload(T)(T v1, T v2)` @@ -23,21 +23,21 @@ fail_compilation/imports/constraints.d(42): `overload(T, must satisfy one of the following constraints: ` N!T N!V` -fail_compilation/constraints_func3.d(56): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()()` +fail_compilation/constraints_func3.d(56): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()()` fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` -fail_compilation/constraints_func3.d(57): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func3.d(57): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()(int)` fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` with `A = int, T = ()` must satisfy the following constraint: ` N!int` -fail_compilation/constraints_func3.d(58): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int, int)` +fail_compilation/constraints_func3.d(58): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()(int, int)` fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` with `A = int, T = (int)` must satisfy the following constraint: ` N!int` -fail_compilation/constraints_func3.d(59): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int, int, int)` +fail_compilation/constraints_func3.d(59): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()(int, int, int)` fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` with `A = int, T = (int, int)` diff --git a/gcc/testsuite/gdc.test/fail_compilation/constraints_func4.d b/gcc/testsuite/gdc.test/fail_compilation/constraints_func4.d index 751e618..4048bae 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/constraints_func4.d +++ b/gcc/testsuite/gdc.test/fail_compilation/constraints_func4.d @@ -3,7 +3,7 @@ EXTRA_FILES: imports/constraints.d REQUIRED_ARGS: -verrors=context TEST_OUTPUT: --- -fail_compilation/constraints_func4.d(90): Error: template `imports.constraints.overload` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func4.d(90): Error: none of the overloads of template `imports.constraints.overload` are callable using argument types `!()(int)` overload(0); ^ fail_compilation/imports/constraints.d(39): Candidates are: `overload(T)(T v)` @@ -24,7 +24,7 @@ void overload(T)(T v1, T v2) if (N!T); fail_compilation/imports/constraints.d(42): `overload(T, V)(T v1, V v2)` void overload(T, V)(T v1, V v2) if (N!T || N!V); ^ -fail_compilation/constraints_func4.d(91): Error: template `imports.constraints.overload` cannot deduce function from argument types `!()(int, string)` +fail_compilation/constraints_func4.d(91): Error: none of the overloads of template `imports.constraints.overload` are callable using argument types `!()(int, string)` overload(0, ""); ^ fail_compilation/imports/constraints.d(39): Candidates are: `overload(T)(T v)` @@ -44,13 +44,13 @@ fail_compilation/imports/constraints.d(42): `overload(T, N!V` void overload(T, V)(T v1, V v2) if (N!T || N!V); ^ -fail_compilation/constraints_func4.d(93): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()()` +fail_compilation/constraints_func4.d(93): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()()` variadic(); ^ fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` void variadic(A, T...)(A a, T v) if (N!int); ^ -fail_compilation/constraints_func4.d(94): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int)` +fail_compilation/constraints_func4.d(94): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()(int)` variadic(0); ^ fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` @@ -60,7 +60,7 @@ fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T. ` N!int` void variadic(A, T...)(A a, T v) if (N!int); ^ -fail_compilation/constraints_func4.d(95): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int, int)` +fail_compilation/constraints_func4.d(95): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()(int, int)` variadic(0, 1); ^ fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` @@ -70,7 +70,7 @@ fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T. ` N!int` void variadic(A, T...)(A a, T v) if (N!int); ^ -fail_compilation/constraints_func4.d(96): Error: template `imports.constraints.variadic` cannot deduce function from argument types `!()(int, int, int)` +fail_compilation/constraints_func4.d(96): Error: none of the overloads of template `imports.constraints.variadic` are callable using argument types `!()(int, int, int)` variadic(0, 1, 2); ^ fail_compilation/imports/constraints.d(43): Candidate is: `variadic(A, T...)(A a, T v)` diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag11819b.d b/gcc/testsuite/gdc.test/fail_compilation/diag11819b.d index a5d6a14..aa43727 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag11819b.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag11819b.d @@ -1,25 +1,24 @@ /* TEST_OUTPUT: --- -fail_compilation/diag11819b.d(28): Error: unrecognized trait `HasMember`, did you mean `hasMember`? -fail_compilation/diag11819b.d(29): Error: unrecognized trait `Identifier`, did you mean `identifier`? -fail_compilation/diag11819b.d(30): Error: unrecognized trait `GetProtection`, did you mean `getProtection`? -fail_compilation/diag11819b.d(31): Error: unrecognized trait `Parent`, did you mean `parent`? -fail_compilation/diag11819b.d(32): Error: unrecognized trait `GetMember`, did you mean `getMember`? -fail_compilation/diag11819b.d(33): Error: unrecognized trait `GetOverloads`, did you mean `getOverloads`? -fail_compilation/diag11819b.d(34): Error: unrecognized trait `GetVirtualFunctions`, did you mean `getVirtualFunctions`? -fail_compilation/diag11819b.d(35): Error: unrecognized trait `GetVirtualMethods`, did you mean `getVirtualMethods`? -fail_compilation/diag11819b.d(36): Error: unrecognized trait `ClassInstanceSize`, did you mean `classInstanceSize`? -fail_compilation/diag11819b.d(37): Error: unrecognized trait `AllMembers`, did you mean `allMembers`? -fail_compilation/diag11819b.d(38): Error: unrecognized trait `DerivedMembers`, did you mean `derivedMembers`? -fail_compilation/diag11819b.d(39): Error: unrecognized trait `IsSame`, did you mean `isSame`? -fail_compilation/diag11819b.d(40): Error: unrecognized trait `Compiles`, did you mean `compiles`? -fail_compilation/diag11819b.d(41): Error: unrecognized trait `Parameters` -fail_compilation/diag11819b.d(42): Error: unrecognized trait `GetAliasThis`, did you mean `getAliasThis`? -fail_compilation/diag11819b.d(43): Error: unrecognized trait `GetAttributes`, did you mean `getAttributes`? -fail_compilation/diag11819b.d(44): Error: unrecognized trait `GetFunctionAttributes`, did you mean `getFunctionAttributes`? -fail_compilation/diag11819b.d(45): Error: unrecognized trait `GetUnitTests`, did you mean `getUnitTests`? -fail_compilation/diag11819b.d(46): Error: unrecognized trait `GetVirtualIndex`, did you mean `getVirtualIndex`? +fail_compilation/diag11819b.d(27): Error: unrecognized trait `HasMember`, did you mean `hasMember`? +fail_compilation/diag11819b.d(28): Error: unrecognized trait `Identifier`, did you mean `identifier`? +fail_compilation/diag11819b.d(29): Error: unrecognized trait `GetProtection`, did you mean `getProtection`? +fail_compilation/diag11819b.d(30): Error: unrecognized trait `Parent`, did you mean `parent`? +fail_compilation/diag11819b.d(31): Error: unrecognized trait `GetMember`, did you mean `getMember`? +fail_compilation/diag11819b.d(32): Error: unrecognized trait `GetOverloads`, did you mean `getOverloads`? +fail_compilation/diag11819b.d(33): Error: unrecognized trait `GetVirtualFunctions`, did you mean `getVirtualFunctions`? +fail_compilation/diag11819b.d(34): Error: unrecognized trait `GetVirtualMethods`, did you mean `getVirtualMethods`? +fail_compilation/diag11819b.d(35): Error: unrecognized trait `ClassInstanceSize`, did you mean `classInstanceSize`? +fail_compilation/diag11819b.d(36): Error: unrecognized trait `AllMembers`, did you mean `allMembers`? +fail_compilation/diag11819b.d(37): Error: unrecognized trait `DerivedMembers`, did you mean `derivedMembers`? +fail_compilation/diag11819b.d(38): Error: unrecognized trait `IsSame`, did you mean `isSame`? +fail_compilation/diag11819b.d(39): Error: unrecognized trait `Compiles`, did you mean `compiles`? +fail_compilation/diag11819b.d(40): Error: unrecognized trait `GetAliasThis`, did you mean `getAliasThis`? +fail_compilation/diag11819b.d(41): Error: unrecognized trait `GetAttributes`, did you mean `getAttributes`? +fail_compilation/diag11819b.d(42): Error: unrecognized trait `GetFunctionAttributes`, did you mean `getFunctionAttributes`? +fail_compilation/diag11819b.d(43): Error: unrecognized trait `GetUnitTests`, did you mean `getUnitTests`? +fail_compilation/diag11819b.d(44): Error: unrecognized trait `GetVirtualIndex`, did you mean `getVirtualIndex`? --- */ @@ -38,7 +37,6 @@ void main() if (__traits(DerivedMembers)) { } if (__traits(IsSame)) { } if (__traits(Compiles)) { } - if (__traits(Parameters)) { } if (__traits(GetAliasThis)) { } if (__traits(GetAttributes)) { } if (__traits(GetFunctionAttributes)) { } diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag13333.d b/gcc/testsuite/gdc.test/fail_compilation/diag13333.d index 34eeaeb..88e8a9d 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag13333.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag13333.d @@ -1,5 +1,5 @@ /* -TEST_OUTPUT* +TEST_OUTPUT: --- fail_compilation/diag13333.d(29): Error: template instance `VariantN!(maxSize!(S), T)` recursive template expansion fail_compilation/diag13333.d(29): Error: template instance `diag13333.maxSize!(S)` error instantiating diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag13942.d b/gcc/testsuite/gdc.test/fail_compilation/diag13942.d index 992d5b8..aeee107 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag13942.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag13942.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/diag13942.d(18): Error: template instance `isRawStaticArray!()` does not match template declaration `isRawStaticArray(T, A...)` -fail_compilation/diag13942.d(26): Error: template `diag13942.to!double.to` cannot deduce function from argument types `!()()` +fail_compilation/diag13942.d(26): Error: none of the overloads of template `diag13942.to!double.to` are callable using argument types `!()()` fail_compilation/diag13942.d(17): Candidate is: `to(A...)(A args)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag16271.d b/gcc/testsuite/gdc.test/fail_compilation/diag16271.d index b85dc8d..e209593 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag16271.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag16271.d @@ -1,5 +1,5 @@ /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/diag16271.d(10): Error: found `x` when expecting function literal following `ref` --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag16977.d b/gcc/testsuite/gdc.test/fail_compilation/diag16977.d index 8f991a7..9d8dcfd 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag16977.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag16977.d @@ -3,7 +3,7 @@ TEST_OUTPUT: --- fail_compilation/diag16977.d(25): Error: undefined identifier `undefined`, did you mean function `undefinedId`? fail_compilation/diag16977.d(26): Error: cannot implicitly convert expression `"\x01string"` of type `string` to `int` -fail_compilation/diag16977.d(27): Error: template `diag16977.templ` cannot deduce function from argument types `!()(int)` +fail_compilation/diag16977.d(27): Error: none of the overloads of template `diag16977.templ` are callable using argument types `!()(int)` fail_compilation/diag16977.d(20): Candidate is: `templ(S)(S s)` with `S = int` must satisfy the following constraint: diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag19225.d b/gcc/testsuite/gdc.test/fail_compilation/diag19225.d index bbb8251..a43a7e1 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag19225.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag19225.d @@ -4,7 +4,7 @@ TEST_OUTPUT: fail_compilation/diag19225.d(14): Error: basic type expected, not `else` fail_compilation/diag19225.d(14): There's no `static else`, use `else` instead. fail_compilation/diag19225.d(14): Error: found `else` without a corresponding `if`, `version` or `debug` statement -fail_compilation/diag19225.d(15): Error: unrecognized declaration +fail_compilation/diag19225.d(15): Error: unmatched closing brace --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag8101.d b/gcc/testsuite/gdc.test/fail_compilation/diag8101.d index a0d245b..282665f 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag8101.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag8101.d @@ -13,12 +13,12 @@ fail_compilation/diag8101.d(38): `diag8101.f_2(int, int, fail_compilation/diag8101.d(39): `diag8101.f_2(int, int, int, int)` fail_compilation/diag8101.d(40): `diag8101.f_2(int, int, int, int, int)` fail_compilation/diag8101.d(59): ... (1 more, -v to show) ... -fail_compilation/diag8101.d(61): Error: template `diag8101.t_0` cannot deduce function from argument types `!()()` +fail_compilation/diag8101.d(61): Error: none of the overloads of template `diag8101.t_0` are callable using argument types `!()()` fail_compilation/diag8101.d(43): Candidate is: `t_0(T1)()` -fail_compilation/diag8101.d(62): Error: template `diag8101.t_1` cannot deduce function from argument types `!()()` +fail_compilation/diag8101.d(62): Error: none of the overloads of template `diag8101.t_1` are callable using argument types `!()()` fail_compilation/diag8101.d(45): Candidates are: `t_1(T1)()` fail_compilation/diag8101.d(46): `t_1(T1, T2)()` -fail_compilation/diag8101.d(63): Error: template `diag8101.t_2` cannot deduce function from argument types `!()()` +fail_compilation/diag8101.d(63): Error: none of the overloads of template `diag8101.t_2` are callable using argument types `!()()` fail_compilation/diag8101.d(48): Candidates are: `t_2(T1)()` fail_compilation/diag8101.d(49): `t_2(T1, T2)()` fail_compilation/diag8101.d(50): `t_2(T1, T2, T3)()` diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag8648.d b/gcc/testsuite/gdc.test/fail_compilation/diag8648.d index f202fb3..a04ed7c 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag8648.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag8648.d @@ -2,13 +2,13 @@ TEST_OUTPUT: --- fail_compilation/diag8648.d(18): Error: undefined identifier `X` -fail_compilation/diag8648.d(29): Error: template `diag8648.foo` cannot deduce function from argument types `!()(Foo!(int, 1))` +fail_compilation/diag8648.d(29): Error: none of the overloads of template `diag8648.foo` are callable using argument types `!()(Foo!(int, 1))` fail_compilation/diag8648.d(18): Candidate is: `foo(T, n)(X!(T, n))` fail_compilation/diag8648.d(20): Error: undefined identifier `a` -fail_compilation/diag8648.d(31): Error: template `diag8648.bar` cannot deduce function from argument types `!()(Foo!(int, 1))` +fail_compilation/diag8648.d(31): Error: none of the overloads of template `diag8648.bar` are callable using argument types `!()(Foo!(int, 1))` fail_compilation/diag8648.d(20): Candidate is: `bar(T)(Foo!(T, a))` fail_compilation/diag8648.d(20): Error: undefined identifier `a` -fail_compilation/diag8648.d(32): Error: template `diag8648.bar` cannot deduce function from argument types `!()(Foo!(int, f))` +fail_compilation/diag8648.d(32): Error: none of the overloads of template `diag8648.bar` are callable using argument types `!()(Foo!(int, f))` fail_compilation/diag8648.d(20): Candidate is: `bar(T)(Foo!(T, a))` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag8684.d b/gcc/testsuite/gdc.test/fail_compilation/diag8684.d index acfee71..9fbbebf 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag8684.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag8684.d @@ -1,8 +1,9 @@ /* TEST_OUTPUT: --- -fail_compilation/diag8684.d(11): Error: found `;` when expecting `)` -fail_compilation/diag8684.d(12): Error: semicolon expected, not `for` +fail_compilation/diag8684.d(12): Error: found `;` when expecting `)` +fail_compilation/diag8684.d(13): Error: semicolon needed to end declaration of `x`, instead of `for` +fail_compilation/diag8684.d(12): `x` declared here --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag9004.d b/gcc/testsuite/gdc.test/fail_compilation/diag9004.d index 62fce32..37d5bd8 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag9004.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag9004.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/diag9004.d(21): Error: template `diag9004.bar` cannot deduce function from argument types `!()(Foo!int, int)` +fail_compilation/diag9004.d(21): Error: none of the overloads of template `diag9004.bar` are callable using argument types `!()(Foo!int, int)` fail_compilation/diag9004.d(14): Candidate is: `bar(FooT)(FooT foo, FooT.T x)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/diag9420.d b/gcc/testsuite/gdc.test/fail_compilation/diag9420.d index 6b2577d..92cb47f 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diag9420.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diag9420.d @@ -1,5 +1,5 @@ /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/diag9420.d(21): Error: function `diag9420.S.t3!().tx()` is not callable using argument types `(int)` fail_compilation/diag9420.d(21): expected 0 argument(s), not 1 diff --git a/gcc/testsuite/gdc.test/fail_compilation/diagin.d b/gcc/testsuite/gdc.test/fail_compilation/diagin.d index a4dabee..eb88a23 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/diagin.d +++ b/gcc/testsuite/gdc.test/fail_compilation/diagin.d @@ -4,7 +4,7 @@ TEST_OUTPUT: --- fail_compilation/diagin.d(14): Error: function `diagin.foo(in int)` is not callable using argument types `()` fail_compilation/diagin.d(14): missing argument for parameter #1: `in int` -fail_compilation/diagin.d(16): Error: template `diagin.foo1` cannot deduce function from argument types `!()(bool[])` +fail_compilation/diagin.d(16): Error: none of the overloads of template `diagin.foo1` are callable using argument types `!()(bool[])` fail_compilation/diagin.d(20): Candidate is: `foo1(T)(in T v, string)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/dip25.d b/gcc/testsuite/gdc.test/fail_compilation/dip25.d index 44fec37..4e803be 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/dip25.d +++ b/gcc/testsuite/gdc.test/fail_compilation/dip25.d @@ -3,7 +3,7 @@ REQUIRED_ARGS: -de TEST_OUTPUT: --- fail_compilation/dip25.d(17): Deprecation: returning `this.buffer[]` escapes a reference to parameter `this` -fail_compilation/dip25.d(17): perhaps annotate the parameter with `return` +fail_compilation/dip25.d(17): perhaps annotate the function with `return` fail_compilation/dip25.d(22): Error: returning `identity(x)` escapes a reference to local variable `x` fail_compilation/dip25.d(23): Deprecation: returning `identity(x)` escapes a reference to parameter `x` fail_compilation/dip25.d(23): perhaps annotate the parameter with `return` diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail10964.d b/gcc/testsuite/gdc.test/fail_compilation/fail10964.d index 4b31a92..de3673f 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail10964.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail10964.d @@ -5,8 +5,8 @@ fail_compilation/fail10964.d(28): Error: function `fail10964.S.__postblit` is no fail_compilation/fail10964.d(29): Error: function `fail10964.S.__postblit` is not `nothrow` fail_compilation/fail10964.d(30): Error: function `fail10964.S.__postblit` is not `nothrow` fail_compilation/fail10964.d(33): Error: function `fail10964.S.__postblit` is not `nothrow` -fail_compilation/fail10964.d(34): Error: function `core.internal.array.construction._d_arraysetctor!(S[], S)._d_arraysetctor` is not `nothrow` -fail_compilation/fail10964.d(35): Error: function `core.internal.array.construction._d_arrayctor!(S[], S)._d_arrayctor` is not `nothrow` +fail_compilation/fail10964.d(34): Error: function `fail10964.S.__postblit` is not `nothrow` +fail_compilation/fail10964.d(35): Error: function `fail10964.S.__postblit` is not `nothrow` fail_compilation/fail10964.d(22): Error: `nothrow` function `fail10964.foo` may throw --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail11453a.d b/gcc/testsuite/gdc.test/fail_compilation/fail11453a.d index 488bc6e..379e86b 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail11453a.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail11453a.d @@ -1,7 +1,7 @@ // REQUIRED_ARGS: -Ifail_compilation/extra-files // EXTRA_SOURCES: extra-files/foo11453.d extra-files/bar11453.d /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/extra-files/bar11453.d(1): Error: package name 'foo11453' conflicts with usage as a module name in file fail_compilation/extra-files/foo11453.d --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail11453b.d b/gcc/testsuite/gdc.test/fail_compilation/fail11453b.d index c9d7b96..4e99395 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail11453b.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail11453b.d @@ -1,7 +1,7 @@ // REQUIRED_ARGS: -Ifail_compilation/extra-files // EXTRA_SOURCES: extra-files/bar11453.d extra-files/foo11453.d /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/extra-files/foo11453.d(1): Error: module `foo11453` from file fail_compilation/extra-files/foo11453.d conflicts with package name foo11453 --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail11653.d b/gcc/testsuite/gdc.test/fail_compilation/fail11653.d index fa69edb..4eeb9be 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail11653.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail11653.d @@ -1,9 +1,8 @@ -// REQUIRED_ARGS: -de /* TEST_OUTPUT: --- -fail_compilation/fail11653.d(19): Deprecation: switch case fallthrough - use 'goto case;' if intended -fail_compilation/fail11653.d(24): Deprecation: switch case fallthrough - use 'goto default;' if intended +fail_compilation/fail11653.d(18): Error: switch case fallthrough - use 'goto case;' if intended +fail_compilation/fail11653.d(23): Error: switch case fallthrough - use 'goto default;' if intended --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail12744.d b/gcc/testsuite/gdc.test/fail_compilation/fail12744.d index 46ed9f6..2056c0e 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail12744.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail12744.d @@ -14,10 +14,10 @@ fail_compilation/fail12744.d(61): Error: template instance `fail12744.bar12744L! fail_compilation/fail12744.d(40): Error: incompatible parameter storage classes `lazy` and `out` fail_compilation/fail12744.d(62): Error: template instance `fail12744.bar12744L!(foo12744O)` error instantiating fail_compilation/fail12744.d(41): Error: incompatible parameter storage classes `auto ref` and `out` -fail_compilation/fail12744.d(67): Error: template `fail12744.bar12744A` cannot deduce function from argument types `!(foo12744O)(int)` +fail_compilation/fail12744.d(67): Error: none of the overloads of template `fail12744.bar12744A` are callable using argument types `!(foo12744O)(int)` fail_compilation/fail12744.d(41): Candidate is: `bar12744A(alias f)(auto ref PTT12744!f args)` fail_compilation/fail12744.d(41): Error: incompatible parameter storage classes `auto ref` and `lazy` -fail_compilation/fail12744.d(68): Error: template `fail12744.bar12744A` cannot deduce function from argument types `!(foo12744L)(int)` +fail_compilation/fail12744.d(68): Error: none of the overloads of template `fail12744.bar12744A` are callable using argument types `!(foo12744L)(int)` fail_compilation/fail12744.d(41): Candidate is: `bar12744A(alias f)(auto ref PTT12744!f args)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail132.d b/gcc/testsuite/gdc.test/fail_compilation/fail132.d index 2c271d9..58ce8a1 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail132.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail132.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail132.d(19): Error: outer class `A` `this` needed to `new` nested class `B` +fail_compilation/fail132.d(19): Error: cannot construct nested class `B` because no implicit `this` reference to outer class `A` is available --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail14669.d b/gcc/testsuite/gdc.test/fail_compilation/fail14669.d index c5ae8e7..be72663 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail14669.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail14669.d @@ -4,7 +4,7 @@ TEST_OUTPUT: fail_compilation/fail14669.d(11): Error: `auto` can only be used as part of `auto ref` for template function parameters fail_compilation/fail14669.d(16): Error: template instance `fail14669.foo1!()` error instantiating fail_compilation/fail14669.d(12): Error: `auto` can only be used as part of `auto ref` for template function parameters -fail_compilation/fail14669.d(17): Error: template `fail14669.foo2` cannot deduce function from argument types `!()(int)` +fail_compilation/fail14669.d(17): Error: none of the overloads of template `fail14669.foo2` are callable using argument types `!()(int)` fail_compilation/fail14669.d(12): Candidate is: `foo2()(auto int a)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail162.d b/gcc/testsuite/gdc.test/fail_compilation/fail162.d index 663e0e1..a537f10 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail162.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail162.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail162.d(25): Error: template `fail162.testHelper` cannot deduce function from argument types `!()(string, string)` +fail_compilation/fail162.d(25): Error: none of the overloads of template `fail162.testHelper` are callable using argument types `!()(string, string)` fail_compilation/fail162.d(10): Candidate is: `testHelper(A...)()` fail_compilation/fail162.d(30): Error: template instance `fail162.test!("hello", "world")` error instantiating --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail18417.d b/gcc/testsuite/gdc.test/fail_compilation/fail18417.d index b32a99b..7da7bd1 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail18417.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail18417.d @@ -1,4 +1,4 @@ -// REQUIRED_ARGS : -de +// REQUIRED_ARGS: -de /* TEST_OUTPUT: --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail196.d b/gcc/testsuite/gdc.test/fail_compilation/fail196.d index 78fc361..c7b28cf 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail196.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail196.d @@ -1,23 +1,24 @@ /* TEST_OUTPUT: --- -fail_compilation/fail196.d(26): Error: delimited string must end in )" -fail_compilation/fail196.d(26): Error: Implicit string concatenation is error-prone and disallowed in D -fail_compilation/fail196.d(26): Use the explicit syntax instead (concatenating literals is `@nogc`): "foo(xxx)" ~ ";\x0a assert(s == " -fail_compilation/fail196.d(27): Error: semicolon expected, not `foo` -fail_compilation/fail196.d(27): Error: found `");\x0a\x0a s = q"` when expecting `;` following statement -fail_compilation/fail196.d(29): Error: found `";\x0a assert(s == "` when expecting `;` following statement -fail_compilation/fail196.d(30): Error: found `");\x0a\x0a s = q"` when expecting `;` following statement -fail_compilation/fail196.d(32): Error: found `{` when expecting `;` following statement -fail_compilation/fail196.d(32): Error: found `}` when expecting `;` following statement -fail_compilation/fail196.d(33): Error: found `foo` when expecting `;` following statement +fail_compilation/fail196.d(27): Error: delimited string must end in )" +fail_compilation/fail196.d(27): Error: Implicit string concatenation is error-prone and disallowed in D +fail_compilation/fail196.d(27): Use the explicit syntax instead (concatenating literals is `@nogc`): "foo(xxx)" ~ ";\x0a assert(s == " +fail_compilation/fail196.d(28): Error: semicolon needed to end declaration of `s`, instead of `foo` +fail_compilation/fail196.d(27): `s` declared here +fail_compilation/fail196.d(28): Error: found `");\x0a\x0a s = q"` when expecting `;` following statement +fail_compilation/fail196.d(30): Error: found `";\x0a assert(s == "` when expecting `;` following statement +fail_compilation/fail196.d(31): Error: found `");\x0a\x0a s = q"` when expecting `;` following statement +fail_compilation/fail196.d(33): Error: found `{` when expecting `;` following statement fail_compilation/fail196.d(33): Error: found `}` when expecting `;` following statement -fail_compilation/fail196.d(35): Error: found `<` when expecting `;` following statement -fail_compilation/fail196.d(36): Error: found `foo` when expecting `;` following statement -fail_compilation/fail196.d(36): Error: found `<` instead of statement -fail_compilation/fail196.d(42): Error: unterminated string constant starting at fail_compilation/fail196.d(42) -fail_compilation/fail196.d(44): Error: found `End of File` when expecting `}` following compound statement -fail_compilation/fail196.d(44): Error: found `End of File` when expecting `}` following compound statement +fail_compilation/fail196.d(34): Error: found `foo` when expecting `;` following statement +fail_compilation/fail196.d(34): Error: found `}` when expecting `;` following statement +fail_compilation/fail196.d(36): Error: found `<` when expecting `;` following statement +fail_compilation/fail196.d(37): Error: found `foo` when expecting `;` following statement +fail_compilation/fail196.d(37): Error: found `<` instead of statement +fail_compilation/fail196.d(43): Error: unterminated string constant starting at fail_compilation/fail196.d(43) +fail_compilation/fail196.d(45): Error: found `End of File` when expecting `}` following compound statement +fail_compilation/fail196.d(45): Error: found `End of File` when expecting `}` following compound statement --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19609.d b/gcc/testsuite/gdc.test/fail_compilation/fail19609.d index c68f199..d2e146c 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail19609.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail19609.d @@ -1,7 +1,7 @@ // https://issues.dlang.org/show_bug.cgi?id=19609 /* EXTRA_FILES: imports/fail19609a.d imports/fail19609b.d imports/fail19609c.d imports/fail19609d.d -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/imports/fail19609a.d(1): Error: `string` expected for deprecation message, not `([""])` of type `string[]` fail_compilation/fail19609.d(16): Deprecation: module `imports.fail19609a` is deprecated diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19897.d b/gcc/testsuite/gdc.test/fail_compilation/fail19897.d index d5e6f57..4f5804b 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail19897.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail19897.d @@ -1,5 +1,5 @@ /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/fail19897.d(9): Error: cannot implicitly convert expression `[]` of type `const(char[0])` to `const(char)` --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail207.d b/gcc/testsuite/gdc.test/fail_compilation/fail207.d index 2a00f7f..2fec197 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail207.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail207.d @@ -1,8 +1,9 @@ /* TEST_OUTPUT: --- -fail_compilation/fail207.d(10): Error: found end of file instead of initializer -fail_compilation/fail207.d(10): Error: semicolon expected, not `End of File` +fail_compilation/fail207.d(11): Error: found end of file instead of initializer +fail_compilation/fail207.d(11): Error: semicolon needed to end declaration of `x`, instead of `End of File` +fail_compilation/fail207.d(10): `x` declared here --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail20730b.d b/gcc/testsuite/gdc.test/fail_compilation/fail20730b.d index 9320423..00dd9fd 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail20730b.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail20730b.d @@ -3,7 +3,7 @@ REQUIRED_ARGS: -verrors=spec -o- TEST_OUTPUT: --- (spec:1) fail_compilation/fail20730b.d-mixin-43(43): Error: C style cast illegal, use `cast(int)mod` -fail_compilation/fail20730b.d(26): Error: template `fail20730b.atomicOp` cannot deduce function from argument types `!("+=")(shared(uint), int)` +fail_compilation/fail20730b.d(26): Error: none of the overloads of template `fail20730b.atomicOp` are callable using argument types `!("+=")(shared(uint), int)` fail_compilation/fail20730b.d(41): Candidate is: `atomicOp(string op, T, V1)(shared ref T val, V1 mod)` with `op = "+=", T = uint, diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail21830.d b/gcc/testsuite/gdc.test/fail_compilation/fail21830.d index 9955c65..2e0f84b 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail21830.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail21830.d @@ -1,5 +1,5 @@ /* REQUIRED_ARGS: -de -unittest -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/fail21830.d(24): Deprecation: struct `fail21830.OldS21830` is deprecated - Deprecated type fail_compilation/fail21830.d(24): Deprecation: template `fail21830.test21830(T)(T t) if (is(T == OldS21830))` is deprecated - Deprecated template diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail21831.d b/gcc/testsuite/gdc.test/fail_compilation/fail21831.d index 699ef0b..3955133 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail21831.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail21831.d @@ -1,5 +1,5 @@ /* REQUIRED_ARGS: -de -unittest -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/fail21831.d(19): Deprecation: struct `fail21831.S21831` is deprecated - Deprecated type fail_compilation/fail21831.d(19): Deprecation: template `fail21831.test21831(T)(T t) if (__traits(isDeprecated, T))` is deprecated - Deprecated template diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail21832.d b/gcc/testsuite/gdc.test/fail_compilation/fail21832.d index 03753a4..98f3df7 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail21832.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail21832.d @@ -1,7 +1,7 @@ // REQUIRED_ARGS: -de // EXTRA_FILES: imports/imp21832.d /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/fail21832.d(4): Deprecation: function `imports.imp21832.fun` is deprecated fail_compilation/fail21832.d(10): Deprecation: template `imports.imp21832.tpl()(char a)` is deprecated diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail220.d b/gcc/testsuite/gdc.test/fail_compilation/fail220.d index 294dc21..d3905d7 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail220.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail220.d @@ -5,7 +5,7 @@ fail_compilation/fail220.d(12): Error: identifier expected for template value pa fail_compilation/fail220.d(12): Error: found `==` when expecting `)` fail_compilation/fail220.d(12): Error: found `class` when expecting `)` fail_compilation/fail220.d(12): Error: declaration expected, not `)` -fail_compilation/fail220.d(16): Error: unrecognized declaration +fail_compilation/fail220.d(16): Error: unmatched closing brace --- */ template types (T) { diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22035.d b/gcc/testsuite/gdc.test/fail_compilation/fail22035.d index ba03be6..2e67b4d 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail22035.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail22035.d @@ -1,5 +1,5 @@ // https://issues.dlang.org/show_bug.cgi?id=22035 -/* TEST_OUTPUT +/* TEST_OUTPUT: --- fail_compilation/fail22035.d(10): Error: found `2` when expecting `:` fail_compilation/fail22035.d(10): Error: found `:` instead of statement diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22084.d b/gcc/testsuite/gdc.test/fail_compilation/fail22084.d index bd11832..b0ae722 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail22084.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail22084.d @@ -1,6 +1,6 @@ // https://issues.dlang.org/show_bug.cgi?id=22084 /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/fail22084.d(22): Error: cannot pass types that need destruction as variadic arguments --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22133.d b/gcc/testsuite/gdc.test/fail_compilation/fail22133.d index 338d96d..a30d430 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail22133.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail22133.d @@ -1,6 +1,6 @@ // https://issues.dlang.org/show_bug.cgi?id=22133 /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/fail22133.d(16): Error: `s.popFront()()` has no effect fail_compilation/fail22133.d(17): Error: template `s.popFront()()` has no type diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22144.d b/gcc/testsuite/gdc.test/fail_compilation/fail22144.d index e0fd5b1..694c1e9 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail22144.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail22144.d @@ -1,5 +1,5 @@ // https://issues.dlang.org/show_bug.cgi?id=22144 -/* TEST_OUTPUT +/* TEST_OUTPUT: --- fail_compilation/fail22144.d(12): Error: cannot cast expression `zarray1` of type `int[0]` to `int[0][]` since sizes don't line up --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail22749.d b/gcc/testsuite/gdc.test/fail_compilation/fail22749.d new file mode 100644 index 0000000..56ccac6 --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/fail22749.d @@ -0,0 +1,13 @@ +// EXTRA_FILES: imports/imp22749.c +/* TEST_OUTPUT: +--- +fail_compilation/fail22749.d(12): Error: cannot take address of bit-field `field` +--- +*/ +import imports.imp22749; + +void test22749() +{ + S22749 s; + void* ptr = &s.field; +} diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail236.d b/gcc/testsuite/gdc.test/fail_compilation/fail236.d index f63eb21..626ec00 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail236.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail236.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/fail236.d(14): Error: undefined identifier `x` -fail_compilation/fail236.d(22): Error: template `fail236.Templ2` cannot deduce function from argument types `!()(int)` +fail_compilation/fail236.d(22): Error: none of the overloads of template `fail236.Templ2` are callable using argument types `!()(int)` fail_compilation/fail236.d(12): Candidate is: `Templ2(alias a)(x)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail276.d b/gcc/testsuite/gdc.test/fail_compilation/fail276.d index 4f9b7c3..b5a99a9 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail276.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail276.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/fail276.d(19): Error: `this` has no effect -fail_compilation/fail276.d(15): Error: `this` is only defined in non-static member functions, not `__anonclass2` +fail_compilation/fail276.d(15): Error: cannot construct anonymous nested class because no implicit `this` reference to outer class is available --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail4269e.d b/gcc/testsuite/gdc.test/fail_compilation/fail4269e.d index c63bfac..8a95b34 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail4269e.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail4269e.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail4269e.d(10): Error: semicolon expected, not `X5` +fail_compilation/fail4269e.d(10): Error: semicolon needed to end declaration of `Y` instead of `X5` fail_compilation/fail4269e.d(10): Error: no identifier for declarator `X5` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail59.d b/gcc/testsuite/gdc.test/fail_compilation/fail59.d index 8c51311..5360495 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail59.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail59.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail59.d(50): Error: outer class `C1` `this` needed to `new` nested class `C2` +fail_compilation/fail59.d(50): Error: cannot construct nested class `C2` because no implicit `this` reference to outer class `C1` is available --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail60.d b/gcc/testsuite/gdc.test/fail_compilation/fail60.d index ec8de0b..137dfa9 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail60.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail60.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail60.d(14): Error: `this` is only defined in non-static member functions, not `A` +fail_compilation/fail60.d(14): Error: cannot construct nested class `B` because no implicit `this` reference to outer class `A` is available --- */ class A diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail8009.d b/gcc/testsuite/gdc.test/fail_compilation/fail8009.d index a06dec5..235e480 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail8009.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail8009.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail8009.d(9): Error: template `fail8009.filter` cannot deduce function from argument types `!()(void)` +fail_compilation/fail8009.d(9): Error: none of the overloads of template `fail8009.filter` are callable using argument types `!()(void)` fail_compilation/fail8009.d(8): Candidate is: `filter(R)(scope bool delegate(ref BAD!R) func)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail95.d b/gcc/testsuite/gdc.test/fail_compilation/fail95.d index b1f046a..7057a01 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/fail95.d +++ b/gcc/testsuite/gdc.test/fail_compilation/fail95.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/fail95.d(19): Error: template `fail95.A` cannot deduce function from argument types `!()(int)` +fail_compilation/fail95.d(19): Error: none of the overloads of template `fail95.A` are callable using argument types `!()(int)` fail_compilation/fail95.d(11): Candidate is: `A(alias T)(T)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/fix17635.d b/gcc/testsuite/gdc.test/fail_compilation/fix17635.d deleted file mode 100644 index 27f55e0..0000000 --- a/gcc/testsuite/gdc.test/fail_compilation/fix17635.d +++ /dev/null @@ -1,23 +0,0 @@ -/* REQUIRED_ARGS: -preview=dip1000 -TEST_OUTPUT: ---- -fail_compilation/fix17635.d(22): Error: cannot implicitly convert expression `f(& p)` of type `immutable(int)**` to `immutable(int**)` ---- -*/ -// https://issues.dlang.org/show_bug.cgi?id=17635 -// https://issues.dlang.org/show_bug.cgi?id=15660 - -alias T = immutable int; - -T** f(const T** input) pure -{ - T** output; - return output; -} - -void main() -{ - T i; - T* p = &i; - immutable T** r = f(&p); -} diff --git a/gcc/testsuite/gdc.test/fail_compilation/ice11856_0.d b/gcc/testsuite/gdc.test/fail_compilation/ice11856_0.d index 36bc2bd..1e51a06 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/ice11856_0.d +++ b/gcc/testsuite/gdc.test/fail_compilation/ice11856_0.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/ice11856_0.d(19): Error: template `ice11856_0.f` cannot deduce function from argument types `!()(int)` +fail_compilation/ice11856_0.d(19): Error: none of the overloads of template `ice11856_0.f` are callable using argument types `!()(int)` fail_compilation/ice11856_0.d(13): Candidates are: `f(T)(T t)` fail_compilation/ice11856_0.d(16): `f(T)(T t)` with `T = int` diff --git a/gcc/testsuite/gdc.test/fail_compilation/ice11856_1.d b/gcc/testsuite/gdc.test/fail_compilation/ice11856_1.d index 70991ae..d2a1d1d 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/ice11856_1.d +++ b/gcc/testsuite/gdc.test/fail_compilation/ice11856_1.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/ice11856_1.d(13): Error: template `ice11856_1.g` cannot deduce function from argument types `!()(A)` +fail_compilation/ice11856_1.d(13): Error: none of the overloads of template `ice11856_1.g` are callable using argument types `!()(A)` fail_compilation/ice11856_1.d(11): Candidate is: `g(T)(T x)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/ice14130.d b/gcc/testsuite/gdc.test/fail_compilation/ice14130.d index 53e35a6..c64fb84 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/ice14130.d +++ b/gcc/testsuite/gdc.test/fail_compilation/ice14130.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/ice14130.d(10): Error: undefined identifier `Undef` -fail_compilation/ice14130.d(14): Error: template `ice14130.foo` cannot deduce function from argument types `!()(int)` +fail_compilation/ice14130.d(14): Error: none of the overloads of template `ice14130.foo` are callable using argument types `!()(int)` fail_compilation/ice14130.d(10): Candidate is: `foo(R, F = Undef)(R r, F s = 0)` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/ice14907.d b/gcc/testsuite/gdc.test/fail_compilation/ice14907.d index ac4ba68..e1d7aac 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/ice14907.d +++ b/gcc/testsuite/gdc.test/fail_compilation/ice14907.d @@ -6,7 +6,7 @@ fail_compilation/ice14907.d(19): while looking for match for `S!()` fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion fail_compilation/ice14907.d(20): while looking for match for `f!()` fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion -fail_compilation/ice14907.d(21): Error: template `ice14907.f` cannot deduce function from argument types `!()()` +fail_compilation/ice14907.d(21): Error: none of the overloads of template `ice14907.f` are callable using argument types `!()()` fail_compilation/ice14907.d(15): Candidate is: `f(int v = f)()` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/ice6538.d b/gcc/testsuite/gdc.test/fail_compilation/ice6538.d index 0715db5..f7c639d 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/ice6538.d +++ b/gcc/testsuite/gdc.test/fail_compilation/ice6538.d @@ -7,7 +7,7 @@ TEST_OUTPUT: --- fail_compilation/ice6538.d(23): Error: expression `super` is not a valid template value argument -fail_compilation/ice6538.d(28): Error: template `ice6538.D.foo` cannot deduce function from argument types `!()()` +fail_compilation/ice6538.d(28): Error: none of the overloads of template `ice6538.D.foo` are callable using argument types `!()()` fail_compilation/ice6538.d(23): Candidate is: `foo()()` --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/ice9284.d b/gcc/testsuite/gdc.test/fail_compilation/ice9284.d index a6d84ae..00602d2 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/ice9284.d +++ b/gcc/testsuite/gdc.test/fail_compilation/ice9284.d @@ -1,7 +1,7 @@ /* TEST_OUTPUT: --- -fail_compilation/ice9284.d(14): Error: template `ice9284.C.__ctor` cannot deduce function from argument types `!()(int)` +fail_compilation/ice9284.d(14): Error: none of the overloads of template `ice9284.C.__ctor` are callable using argument types `!()(int)` fail_compilation/ice9284.d(12): Candidate is: `__ctor()(string)` fail_compilation/ice9284.d(20): Error: template instance `ice9284.C.__ctor!()` error instantiating --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/imports/imp18554.d b/gcc/testsuite/gdc.test/fail_compilation/imports/imp18554.d deleted file mode 100644 index 9f2a855..0000000 --- a/gcc/testsuite/gdc.test/fail_compilation/imports/imp18554.d +++ /dev/null @@ -1,4 +0,0 @@ -struct S -{ - private int i; -} diff --git a/gcc/testsuite/gdc.test/fail_compilation/imports/imp22749.c b/gcc/testsuite/gdc.test/fail_compilation/imports/imp22749.c new file mode 100644 index 0000000..7c1850e --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/imports/imp22749.c @@ -0,0 +1,4 @@ +struct S22749 +{ + int field : 1; +}; diff --git a/gcc/testsuite/gdc.test/fail_compilation/issue21936.d b/gcc/testsuite/gdc.test/fail_compilation/issue21936.d deleted file mode 100644 index a37aa04..0000000 --- a/gcc/testsuite/gdc.test/fail_compilation/issue21936.d +++ /dev/null @@ -1,32 +0,0 @@ -/* REQUIRED_ARGS: -preview=dip1000 -Ifail_compilation/imports -TEST_OUTPUT: ---- -fail_compilation/issue21936.d(15): Error: struct `issue21936s.S` variable `field` is not accessible from `@safe` code -fail_compilation/issue21936.d(15): Error: struct `issue21936s.S` variable `field` is not accessible from `@safe` code -fail_compilation/issue21936.d(11): Error: template instance `issue21936.constructImplicit!(S)` error instantiating -fail_compilation/issue21936.d(7): instantiated from here: `registerConstructors!(S)` -fail_compilation/issue21936.d(21): instantiated from here: `registerType!(S)` ---- -*/ -#line 2 -module issue21936; -import issue21936s; -struct Handlers { - void registerType(T)() - { - registerConstructors!T; - } - void registerConstructors(T)() - { - constructImplicit!T; - } -} - -auto constructImplicit(T)(typeof(T.init.tupleof) x = T.init.tupleof) -{ -} - -void registerHandlersDateTime(Handlers handlers) -{ - handlers.registerType!(S); -} diff --git a/gcc/testsuite/gdc.test/fail_compilation/noreturn.d b/gcc/testsuite/gdc.test/fail_compilation/noreturn.d index 4a588b4..696081a 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/noreturn.d +++ b/gcc/testsuite/gdc.test/fail_compilation/noreturn.d @@ -16,8 +16,8 @@ fail_compilation\noreturn.d(69): Error: `"Accessed expression of type `noreturn` fail_compilation\noreturn.d(79): called from here: `casting(1)` fail_compilation\noreturn.d(72): Error: `"Accessed expression of type `noreturn`"` fail_compilation\noreturn.d(80): called from here: `casting(2)` +fail_compilation/noreturn.d(120): Error: uncaught CTFE exception `object.Exception("")` --- - https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1034.md */ @@ -116,3 +116,5 @@ int inClassRef() enum forceInClassRef = inClassRef(); */ + +enum throwEnum = throw new Exception(""); diff --git a/gcc/testsuite/gdc.test/fail_compilation/noreturn2.d b/gcc/testsuite/gdc.test/fail_compilation/noreturn2.d index e7d28dc..2d27d6d 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/noreturn2.d +++ b/gcc/testsuite/gdc.test/fail_compilation/noreturn2.d @@ -88,3 +88,54 @@ auto returnVoid3(int i) else return doStuff(); } + +/+ +TEST_OUTPUT: +--- +fail_compilation/noreturn2.d(104): Error: `object.Exception` is thrown but not caught +fail_compilation/noreturn2.d(100): Error: `nothrow` function `noreturn2.doesNestedThrow` may throw +--- ++/ + +int doesNestedThrow(int i) nothrow +{ + // Weird formatting is intended to check the loc + return i ? i++ : + throw + new + Exception("") + ; +} + +int doesNestedThrowThrowable(int i) nothrow +{ + return i ? i++ : throw new Error(""); +} + +/+ +TEST_OUTPUT: +--- +fail_compilation/noreturn2.d(130): Error: cannot create instance of interface `I` +fail_compilation/noreturn2.d(133): Error: can only throw class objects derived from `Throwable`, not type `int[]` +fail_compilation/noreturn2.d(138): Error: undefined identifier `UnkownException` +--- ++/ + +int throwInvalid(int i) nothrow +{ + static interface I {} + // Weird formatting is intended to check the loc + return + throw + new + I() + ? + throw + new + int[4] + : + throw + new + UnkownException("") + ; +} diff --git a/gcc/testsuite/gdc.test/fail_compilation/objc_class2.d b/gcc/testsuite/gdc.test/fail_compilation/objc_class2.d index 9d6658c..b4d3cd7 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/objc_class2.d +++ b/gcc/testsuite/gdc.test/fail_compilation/objc_class2.d @@ -1,4 +1,4 @@ -// EXTRA_OBJC_SOURCES +// EXTRA_OBJC_SOURCES: /* TEST_OUTPUT: --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/objc_class3.d b/gcc/testsuite/gdc.test/fail_compilation/objc_class3.d index f76443d..cf2480e 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/objc_class3.d +++ b/gcc/testsuite/gdc.test/fail_compilation/objc_class3.d @@ -1,4 +1,4 @@ -// EXTRA_OBJC_SOURCES +// EXTRA_OBJC_SOURCES: /* TEST_OUTPUT: --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/objc_non_objc_base.d b/gcc/testsuite/gdc.test/fail_compilation/objc_non_objc_base.d index 6e2b078..9956212 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/objc_non_objc_base.d +++ b/gcc/testsuite/gdc.test/fail_compilation/objc_non_objc_base.d @@ -1,4 +1,4 @@ -// EXTRA_OBJC_SOURCES +// EXTRA_OBJC_SOURCES: /* TEST_OUTPUT: --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/reg6769.d b/gcc/testsuite/gdc.test/fail_compilation/reg6769.d index b11fac9..86e37e7 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/reg6769.d +++ b/gcc/testsuite/gdc.test/fail_compilation/reg6769.d @@ -1,5 +1,5 @@ /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/reg6769.d(14): Error: reinterpreting cast from `int[]` to `int[7]*` is not supported in CTFE fail_compilation/reg6769.d(27): called from here: `reg6769a([0, 1, 2, 3, 4, 5, 6])` diff --git a/gcc/testsuite/gdc.test/fail_compilation/reserved_version.d b/gcc/testsuite/gdc.test/fail_compilation/reserved_version.d index 43998b9..eeea28c 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/reserved_version.d +++ b/gcc/testsuite/gdc.test/fail_compilation/reserved_version.d @@ -115,6 +115,7 @@ fail_compilation/reserved_version.d(216): Error: version identifier `D_PIE` is r fail_compilation/reserved_version.d(217): Error: version identifier `AVR` is reserved and cannot be set fail_compilation/reserved_version.d(218): Error: version identifier `D_PreConditions` is reserved and cannot be set fail_compilation/reserved_version.d(219): Error: version identifier `D_PostConditions` is reserved and cannot be set +fail_compilation/reserved_version.d(220): Error: version identifier `D_ProfileGC` is reserved and cannot be set --- */ @@ -236,6 +237,7 @@ version = D_PIE; version = AVR; version = D_PreConditions; version = D_PostConditions; +version = D_ProfileGC; // This should work though debug = DigitalMars; @@ -346,3 +348,4 @@ debug = MSP430; debug = AVR; debug = D_PreConditions; debug = D_PostConditions; +debug = D_ProfileGC; diff --git a/gcc/testsuite/gdc.test/fail_compilation/reserved_version_switch.d b/gcc/testsuite/gdc.test/fail_compilation/reserved_version_switch.d index 6333309..792ea0a 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/reserved_version_switch.d +++ b/gcc/testsuite/gdc.test/fail_compilation/reserved_version_switch.d @@ -105,6 +105,7 @@ // REQUIRED_ARGS: -version=none // REQUIRED_ARGS: -version=D_PreConditions // REQUIRED_ARGS: -version=D_PostConditions +// REQUIRED_ARGS: -version=D_ProfileGC // REQUIRED_ARGS: -debug=DigitalMars // REQUIRED_ARGS: -debug=GNU // REQUIRED_ARGS: -debug=LDC @@ -207,6 +208,7 @@ // REQUIRED_ARGS: -debug=none // REQUIRED_ARGS: -debug=D_PreConditions // REQUIRED_ARGS: -debug=D_PostConditions +// REQUIRED_ARGS: -debug=D_ProfileGC /* TEST_OUTPUT: --- @@ -315,5 +317,6 @@ Error: version identifier `all` is reserved and cannot be set Error: version identifier `none` is reserved and cannot be set Error: version identifier `D_PreConditions` is reserved and cannot be set Error: version identifier `D_PostConditions` is reserved and cannot be set +Error: version identifier `D_ProfileGC` is reserved and cannot be set --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/retscope5.d b/gcc/testsuite/gdc.test/fail_compilation/retscope5.d index 1f9906e..0625d8e 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/retscope5.d +++ b/gcc/testsuite/gdc.test/fail_compilation/retscope5.d @@ -5,7 +5,7 @@ REQUIRED_ARGS: -preview=dip1000 /* TEST_OUTPUT: --- -fail_compilation/retscope5.d(5010): Error: reference `t` assigned to `p` with longer lifetime +fail_compilation/retscope5.d(5010): Error: address of variable `t` assigned to `p` with longer lifetime --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/test15191.d b/gcc/testsuite/gdc.test/fail_compilation/test15191.d index 1b3078f..fea9fb7 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test15191.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test15191.d @@ -1,5 +1,5 @@ /* TEST_OUTPUT: -PERMUTE_ARGS -dip1000 +PERMUTE_ARGS: -dip1000 --- fail_compilation/test15191.d(31): Error: returning `&identity(x)` escapes a reference to local variable `x` fail_compilation/test15191.d(37): Error: returning `&identityPtr(x)` escapes a reference to local variable `x` diff --git a/gcc/testsuite/gdc.test/fail_compilation/test16188.d b/gcc/testsuite/gdc.test/fail_compilation/test16188.d index 38219e9..87c55ea 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test16188.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test16188.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/test16188.d(1): Error: no identifier for declarator `TEST_OUTPUT` fail_compilation/test16188.d(1): Error: declaration expected, not `:` -fail_compilation/test16188.d(18): Error: unrecognized declaration +fail_compilation/test16188.d(18): Error: unmatched closing brace --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/test16589.d b/gcc/testsuite/gdc.test/fail_compilation/test16589.d index 7b1f14f..0e86081 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test16589.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test16589.d @@ -3,9 +3,9 @@ REQUIRED_ARGS: -preview=dip1000 TEST_OUTPUT: --- fail_compilation/test16589.d(26): Error: returning `&this.data` escapes a reference to parameter `this` -fail_compilation/test16589.d(26): perhaps annotate the parameter with `return` +fail_compilation/test16589.d(26): perhaps annotate the function with `return` fail_compilation/test16589.d(31): Error: returning `&this` escapes a reference to parameter `this` -fail_compilation/test16589.d(31): perhaps annotate the parameter with `return` +fail_compilation/test16589.d(31): perhaps annotate the function with `return` fail_compilation/test16589.d(37): Error: returning `&s.data` escapes a reference to parameter `s` fail_compilation/test16589.d(37): perhaps annotate the parameter with `return` fail_compilation/test16589.d(42): Error: returning `&s` escapes a reference to parameter `s` diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17284.d b/gcc/testsuite/gdc.test/fail_compilation/test17284.d index a0ea05b..ef19a56 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test17284.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test17284.d @@ -2,7 +2,7 @@ TEST_OUTPUT: --- fail_compilation/test17284.d(1): Error: no identifier for declarator `TEST_OUTPUT` fail_compilation/test17284.d(1): Error: declaration expected, not `:` -fail_compilation/test17284.d(12): Error: unrecognized declaration +fail_compilation/test17284.d(12): Error: unmatched closing brace --- */ diff --git a/gcc/testsuite/gdc.test/fail_compilation/test17450.d b/gcc/testsuite/gdc.test/fail_compilation/test17450.d index 6d0e25a..f350cbd 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test17450.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test17450.d @@ -5,7 +5,7 @@ TEST_OUTPUT: fail_compilation/test17450.d(17): Error: returning `&s.bar` escapes a reference to parameter `s` fail_compilation/test17450.d(17): perhaps annotate the parameter with `return` fail_compilation/test17450.d(20): Error: returning `&this.bar` escapes a reference to parameter `this` -fail_compilation/test17450.d(20): perhaps annotate the parameter with `return` +fail_compilation/test17450.d(20): perhaps annotate the function with `return` --- */ // https://issues.dlang.org/show_bug.cgi?id=17450 diff --git a/gcc/testsuite/gdc.test/fail_compilation/test18554.d b/gcc/testsuite/gdc.test/fail_compilation/test18554.d deleted file mode 100644 index acbda50..0000000 --- a/gcc/testsuite/gdc.test/fail_compilation/test18554.d +++ /dev/null @@ -1,24 +0,0 @@ -/* REQUIRED_ARGS: -preview=dip1000 -EXTRA_FILES: imports/imp18554.d -TEST_OUTPUT: ---- -fail_compilation/test18554.d(16): Error: struct `imp18554.S` variable `i` is not accessible from `@safe` code ---- -*/ - -// https://issues.dlang.org/show_bug.cgi?id=18554 - -import imports.imp18554; - -void test1() @safe -{ - S s; - s.tupleof[0] = 1; -} - -void test2() -{ - S s; - s.tupleof[0] = 1; -} - diff --git a/gcc/testsuite/gdc.test/fail_compilation/test19107.d b/gcc/testsuite/gdc.test/fail_compilation/test19107.d index 98858b4..93d86bf 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test19107.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test19107.d @@ -2,7 +2,7 @@ EXTRA_FILES: imports/imp19661.d imports/test19107a.d imports/test19107b.d TEST_OUTPUT: --- -fail_compilation/test19107.d(24): Error: template `test19107.all` cannot deduce function from argument types `!((c) => c)(string[])` +fail_compilation/test19107.d(24): Error: none of the overloads of template `test19107.all` are callable using argument types `!((c) => c)(string[])` fail_compilation/test19107.d(18): Candidate is: `all(alias pred, T)(T t)` with `pred = __lambda2, T = string[]` diff --git a/gcc/testsuite/gdc.test/fail_compilation/test19193.d b/gcc/testsuite/gdc.test/fail_compilation/test19193.d index 9022776..e75d90e 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test19193.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test19193.d @@ -1,6 +1,6 @@ /* REQUIRED_ARGS: -de -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/test19193.d(13): Deprecation: enum member `test19193.T19193!int.A.b` is deprecated --- diff --git a/gcc/testsuite/gdc.test/fail_compilation/test21912.d b/gcc/testsuite/gdc.test/fail_compilation/test21912.d index 8dde98a..5bb92a3 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test21912.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test21912.d @@ -1,6 +1,6 @@ /* PERMUTE_ARGS: -preview=dip1000 -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/test21912.d(24): Error: function `test21912.escapeParam` is `@nogc` yet allocates closures with the GC fail_compilation/test21912.d(26): test21912.escapeParam.__lambda2 closes over variable i at fail_compilation/test21912.d(24) diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22298.d b/gcc/testsuite/gdc.test/fail_compilation/test22298.d new file mode 100644 index 0000000..cdb1a3e --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/test22298.d @@ -0,0 +1,30 @@ +/* +REQUIRED_ARGS: -preview=dip1000 +TEST_OUTPUT: +--- +fail_compilation/test22298.d(18): Error: scope variable `i` assigned to `p` with longer lifetime +fail_compilation/test22298.d(29): Error: scope variable `y` assigned to `x` with longer lifetime +--- +*/ + +void g(scope void delegate(scope int*) @safe cb) @safe { + int x = 42; + cb(&x); +} + +void main() @safe { + int* p; + void f(scope int* i) @safe { + p = i; + } + + g(&f); + // address of x has escaped g + assert(*p == 42); +} + +void f() @safe { + mixin("scope int* x;"); + scope int* y; + x = y; +} diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22541.d b/gcc/testsuite/gdc.test/fail_compilation/test22541.d new file mode 100644 index 0000000..910db0a --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/test22541.d @@ -0,0 +1,18 @@ +/* REQUIRED_ARGS: -preview=dip1000 +TEST_OUTPUT: +--- +fail_compilation/test22541.d(104): Error: returning `i` escapes a reference to parameter `i` +fail_compilation/test22541.d(104): perhaps annotate the parameter with `return` +--- + */ + +/* https://issues.dlang.org/show_bug.cgi?id=22541 + */ + +#line 100 + +@safe +ref int newe(ref return scope int i) // ref, error +{ + return i; +} diff --git a/gcc/testsuite/gdc.test/fail_compilation/test22709.d b/gcc/testsuite/gdc.test/fail_compilation/test22709.d new file mode 100644 index 0000000..dd5258e --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/test22709.d @@ -0,0 +1,29 @@ +/* +REQUIRED_ARGS: -preview=dip1000 +TEST_OUTPUT: +--- +fail_compilation/test22709.d(15): Error: address of variable `local` assigned to `arr` with longer lifetime +fail_compilation/test22709.d(20): Error: address of variable `local` assigned to `arr` with longer lifetime +--- +*/ + +// https://issues.dlang.org/show_bug.cgi?id=22709 +@safe: + +void escape(ref ubyte[] arr, ref ubyte[64] local) +{ + arr = local[]; +} + +void escape1(ref ubyte[64] local, ref ubyte[] arr) +{ + arr = local[]; +} + +ubyte[] getArr() +{ + ubyte[64] blob; + ubyte[] arr; + escape(arr, blob[]); + return arr; +} diff --git a/gcc/testsuite/gdc.test/fail_compilation/test3818.d b/gcc/testsuite/gdc.test/fail_compilation/test3818.d new file mode 100644 index 0000000..c66db85 --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/test3818.d @@ -0,0 +1,27 @@ +/* TEST_OUTPUT: +--- +fail_compilation/test3818.d(104): Error: missing `; expression` before `)` of `foreach` +fail_compilation/test3818.d(104): perhaps the `;` goes before `a` +fail_compilation/test3818.d(109): Error: missing `; expression` before `)` of `foreach` +fail_compilation/test3818.d(109): perhaps the `;` goes before `c` +fail_compilation/test3818.d(110): Error: declaration expected, not `{` +--- +*/ + +// https://issues.dlang.org/show_bug.cgi?id=3818 + +#line 100 + +void test1() +{ + int[10] a; + foreach (i, x, a) + { + } +} + +static foreach (a, b, c) +{ +} + + diff --git a/gcc/testsuite/gdc.test/fail_compilation/test9701.d b/gcc/testsuite/gdc.test/fail_compilation/test9701.d index 384c514..a0310c4 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test9701.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test9701.d @@ -1,5 +1,5 @@ /* -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/test9701.d(38): Error: `@safe` is not a valid attribute for enum members fail_compilation/test9701.d(39): Error: `@system` is not a valid attribute for enum members diff --git a/gcc/testsuite/gdc.test/fail_compilation/test9701b.d b/gcc/testsuite/gdc.test/fail_compilation/test9701b.d index 16c2541..725a4cd 100644 --- a/gcc/testsuite/gdc.test/fail_compilation/test9701b.d +++ b/gcc/testsuite/gdc.test/fail_compilation/test9701b.d @@ -1,6 +1,6 @@ /* REQUIRED_ARGS: -de -TEST_OUTPUT +TEST_OUTPUT: --- fail_compilation/test9701b.d(20): Deprecation: enum member `test9701b.Enum.e0` is deprecated fail_compilation/test9701b.d(21): Deprecation: enum member `test9701b.Enum.e1` is deprecated - message diff --git a/gcc/testsuite/gdc.test/fail_compilation/traits_parameters.d b/gcc/testsuite/gdc.test/fail_compilation/traits_parameters.d new file mode 100644 index 0000000..5021c54 --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/traits_parameters.d @@ -0,0 +1,10 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/traits_parameters.d(9): Error: `__traits(parameters)` cannot have arguments, but `234` was supplied +fail_compilation/traits_parameters.d(10): Error: `__traits(parameters)` may only be used inside a function +--- +*/ + +typeof(__traits(parameters, 234)) xyz; +typeof(__traits(parameters)) x; diff --git a/gcc/testsuite/gdc.test/runnable/a18.d b/gcc/testsuite/gdc.test/runnable/a18.d index f568982..c8ed60d 100644 --- a/gcc/testsuite/gdc.test/runnable/a18.d +++ b/gcc/testsuite/gdc.test/runnable/a18.d @@ -1,5 +1,5 @@ /* -COMPILE_SEPARATELY +COMPILE_SEPARATELY: EXTRA_SOURCES: imports/a18a.d PERMUTE_ARGS: RUN_OUTPUT: diff --git a/gcc/testsuite/gdc.test/runnable/a19.d b/gcc/testsuite/gdc.test/runnable/a19.d index 574f95ca..3681d97 100644 --- a/gcc/testsuite/gdc.test/runnable/a19.d +++ b/gcc/testsuite/gdc.test/runnable/a19.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/a19a.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/b26.d b/gcc/testsuite/gdc.test/runnable/b26.d index 54e28da..b80d072 100644 --- a/gcc/testsuite/gdc.test/runnable/b26.d +++ b/gcc/testsuite/gdc.test/runnable/b26.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/b26a.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/class_opCmp.d b/gcc/testsuite/gdc.test/runnable/class_opCmp.d new file mode 100644 index 0000000..43f31ac --- /dev/null +++ b/gcc/testsuite/gdc.test/runnable/class_opCmp.d @@ -0,0 +1,25 @@ +class A +{ + int x; + this(int a) { x = a; } + + alias opCmp = Object.opCmp; + alias opCmp = my_cmp; + + final int my_cmp(A a) + { + return x - a.x; + } +} + +void main() +{ + auto a1 = new A(1); + auto a2 = new A(2); + A a_null = null; + assert(a1 > a_null); + assert(a_null < a1); + assert(!(a1 < a1)); + assert(a1 < a2); + assert(a2 > a1); +} diff --git a/gcc/testsuite/gdc.test/runnable/fix22624.d b/gcc/testsuite/gdc.test/runnable/fix22624.d new file mode 100644 index 0000000..542899f --- /dev/null +++ b/gcc/testsuite/gdc.test/runnable/fix22624.d @@ -0,0 +1,19 @@ +// https://issues.dlang.org/show_bug.cgi?id=22624 +// EXTRA_FILES: imports/imp22624.c + +import core.stdc.stdio; +import imports.imp22624; + +struct S +{ + B b; + ulong y = 0x1234_0000_5678; +} + +int main() +{ + S s; + //printf("%llx\n", s.y); + assert(s.y == 0x1234_0000_5678); + return 0; +} diff --git a/gcc/testsuite/gdc.test/runnable/ice15138.d b/gcc/testsuite/gdc.test/runnable/ice15138.d index 14d6bfb..95b8c27 100644 --- a/gcc/testsuite/gdc.test/runnable/ice15138.d +++ b/gcc/testsuite/gdc.test/runnable/ice15138.d @@ -1,6 +1,6 @@ // EXTRA_SOURCES: imports/ice15138a.d // PERMUTE_ARGS: -unittest -inline -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: import imports.ice15138a; diff --git a/gcc/testsuite/gdc.test/runnable/ice15176.d b/gcc/testsuite/gdc.test/runnable/ice15176.d index 357207d..b47b4ec 100644 --- a/gcc/testsuite/gdc.test/runnable/ice15176.d +++ b/gcc/testsuite/gdc.test/runnable/ice15176.d @@ -1,5 +1,5 @@ // EXTRA_SOURCES: imports/ice15176a.d imports/ice15176b.d -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: import imports.ice15176a; diff --git a/gcc/testsuite/gdc.test/runnable/ice15200.d b/gcc/testsuite/gdc.test/runnable/ice15200.d index b4e2cc3..2e1abbe 100644 --- a/gcc/testsuite/gdc.test/runnable/ice15200.d +++ b/gcc/testsuite/gdc.test/runnable/ice15200.d @@ -1,5 +1,5 @@ // EXTRA_SOURCES: imports/ice15200a.d imports/ice15200b.d -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: module ice15200; diff --git a/gcc/testsuite/gdc.test/runnable/imports/imp22624.c b/gcc/testsuite/gdc.test/runnable/imports/imp22624.c new file mode 100644 index 0000000..ea726d3 --- /dev/null +++ b/gcc/testsuite/gdc.test/runnable/imports/imp22624.c @@ -0,0 +1,6 @@ + +struct B +{ + unsigned int x : 1; +// unsigned int x; +}; diff --git a/gcc/testsuite/gdc.test/runnable/issue16995.d b/gcc/testsuite/gdc.test/runnable/issue16995.d index 3b028d4..0d59882 100644 --- a/gcc/testsuite/gdc.test/runnable/issue16995.d +++ b/gcc/testsuite/gdc.test/runnable/issue16995.d @@ -1,5 +1,5 @@ // REQUIRED_ARGS: -unittest -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/module_with_tests.d imports/another_module_with_tests.d import imports.module_with_tests; diff --git a/gcc/testsuite/gdc.test/runnable/link10425.d b/gcc/testsuite/gdc.test/runnable/link10425.d index 95faf6f..d082516 100644 --- a/gcc/testsuite/gdc.test/runnable/link10425.d +++ b/gcc/testsuite/gdc.test/runnable/link10425.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/bug10425.d import imports.bug10425; diff --git a/gcc/testsuite/gdc.test/runnable/link11069b.d b/gcc/testsuite/gdc.test/runnable/link11069b.d index 658f46e..33992d1 100644 --- a/gcc/testsuite/gdc.test/runnable/link11069b.d +++ b/gcc/testsuite/gdc.test/runnable/link11069b.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/link11069x.d // EXTRA_SOURCES: imports/link11069y.d // EXTRA_SOURCES: imports/link11069z.d diff --git a/gcc/testsuite/gdc.test/runnable/link11395.d b/gcc/testsuite/gdc.test/runnable/link11395.d index fe25be1..160225e 100644 --- a/gcc/testsuite/gdc.test/runnable/link11395.d +++ b/gcc/testsuite/gdc.test/runnable/link11395.d @@ -1,6 +1,6 @@ // EXTRA_SOURCES: imports/link11395a.d // PERMUTE_ARGS: -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: module link11395; import imports.link11395a; diff --git a/gcc/testsuite/gdc.test/runnable/link12010.d b/gcc/testsuite/gdc.test/runnable/link12010.d index 49c4eb1..fc838d8 100644 --- a/gcc/testsuite/gdc.test/runnable/link12010.d +++ b/gcc/testsuite/gdc.test/runnable/link12010.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/a12010.d // EXTRA_FILES: imports/std12010container.d // REQUIRED_ARGS: -release diff --git a/gcc/testsuite/gdc.test/runnable/link13394.d b/gcc/testsuite/gdc.test/runnable/link13394.d index aea8686..8af0d36 100644 --- a/gcc/testsuite/gdc.test/runnable/link13394.d +++ b/gcc/testsuite/gdc.test/runnable/link13394.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/link13394a.d module link13394; diff --git a/gcc/testsuite/gdc.test/runnable/link13400.d b/gcc/testsuite/gdc.test/runnable/link13400.d index fbb9ec7..3fc4dfb 100644 --- a/gcc/testsuite/gdc.test/runnable/link13400.d +++ b/gcc/testsuite/gdc.test/runnable/link13400.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/link13400a.d import imports.link13400a; diff --git a/gcc/testsuite/gdc.test/runnable/link13415.d b/gcc/testsuite/gdc.test/runnable/link13415.d index 782bb6b..000ece3 100644 --- a/gcc/testsuite/gdc.test/runnable/link13415.d +++ b/gcc/testsuite/gdc.test/runnable/link13415.d @@ -2,7 +2,7 @@ EXTRA_SOURCES: imports/link13415a.d REQUIRED_ARGS: -inline PERMUTE_ARGS: -allinst -unittest -debug -COMPILE_SEPARATELY +COMPILE_SEPARATELY: RUN_OUTPUT: --- i = 77; diff --git a/gcc/testsuite/gdc.test/runnable/link14588.d b/gcc/testsuite/gdc.test/runnable/link14588.d index 2ca4b52..cfc8157 100644 --- a/gcc/testsuite/gdc.test/runnable/link14588.d +++ b/gcc/testsuite/gdc.test/runnable/link14588.d @@ -1,6 +1,6 @@ // EXTRA_SOURCES: imports/link14588a.d // PERMUTE_ARGS: -allinst -unittest -debug -inline -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: import imports.link14588a; diff --git a/gcc/testsuite/gdc.test/runnable/link14814.d b/gcc/testsuite/gdc.test/runnable/link14814.d index ed06500..10b6b6d 100644 --- a/gcc/testsuite/gdc.test/runnable/link14814.d +++ b/gcc/testsuite/gdc.test/runnable/link14814.d @@ -1,6 +1,6 @@ // EXTRA_SOURCES: imports/link14814a.d // PERMUTE_ARGS: -inline -release -g -O -fPIC -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: import imports.link14814a; diff --git a/gcc/testsuite/gdc.test/runnable/link15017.d b/gcc/testsuite/gdc.test/runnable/link15017.d index 16187a8..5d39547 100644 --- a/gcc/testsuite/gdc.test/runnable/link15017.d +++ b/gcc/testsuite/gdc.test/runnable/link15017.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/std15017variant.d /* TEST_OUTPUT: diff --git a/gcc/testsuite/gdc.test/runnable/link7745.d b/gcc/testsuite/gdc.test/runnable/link7745.d index 9a0eccf..a0fdad5 100644 --- a/gcc/testsuite/gdc.test/runnable/link7745.d +++ b/gcc/testsuite/gdc.test/runnable/link7745.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/link7745b.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/link8023.d b/gcc/testsuite/gdc.test/runnable/link8023.d index d4c32cb..e92b150 100644 --- a/gcc/testsuite/gdc.test/runnable/link8023.d +++ b/gcc/testsuite/gdc.test/runnable/link8023.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/link8023b.d // PERMUTE_ARGS: -inline -release diff --git a/gcc/testsuite/gdc.test/runnable/link9571.d b/gcc/testsuite/gdc.test/runnable/link9571.d index 1efdbdd..caa9c78 100644 --- a/gcc/testsuite/gdc.test/runnable/link9571.d +++ b/gcc/testsuite/gdc.test/runnable/link9571.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/link9571a.d import imports.link9571a; diff --git a/gcc/testsuite/gdc.test/runnable/linktypeinfo.d b/gcc/testsuite/gdc.test/runnable/linktypeinfo.d index 04579a2..508e094 100644 --- a/gcc/testsuite/gdc.test/runnable/linktypeinfo.d +++ b/gcc/testsuite/gdc.test/runnable/linktypeinfo.d @@ -1,6 +1,6 @@ // EXTRA_SOURCES: imports/linktypeinfo_file.d // PERMUTE_ARGS: -g -inline -unittest -debug -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: import imports.linktypeinfo_file; diff --git a/gcc/testsuite/gdc.test/runnable/noreturn1.d b/gcc/testsuite/gdc.test/runnable/noreturn1.d index 1da0479..7d15b54 100644 --- a/gcc/testsuite/gdc.test/runnable/noreturn1.d +++ b/gcc/testsuite/gdc.test/runnable/noreturn1.d @@ -112,10 +112,162 @@ void test3() } } +/*****************************************/ + +Exception collectException(void function() f) +{ + try + { + f(); + return null; + } + catch (Exception e) + return e; +} + + +int return_() +{ + return throw new Exception("Return"); +} + +void ternary(int i) +{ + i > 0 ? i++ : throw new Exception("Ternary"); +} + +void call() +{ + ternary(throw new Exception("Call")); +} + +void arrayLiteral() +{ + int[] arr = [ + 1, + throw new Exception("ArrayLiteral"), + 2 + ]; +} + +void assocArrayLiteral() +{ + int[string] arr = [ + "A": 1, + "B": throw new Exception("AssocArrayLiteral"), + "C": 2 + ]; +} + +void testThrowExpression() +{ + Exception ae = collectException({ return_(); }); + assert(ae); + + ae = collectException({ ternary(1); }); + assert(!ae); + + ae = collectException({ ternary(-1); }); + assert(ae); + + ae = collectException(&call); + assert(ae); + assert(ae.msg == "Call"); + + ae = collectException(&arrayLiteral); + assert(ae); + + ae = collectException(&assocArrayLiteral); + assert(ae); +} + + +/*****************************************/ + +/// Verify that throws does not screw with side effects +void testThrowSideEffect() +{ + static void foo(bool, void*, int) {} + + bool b; + int i; + + try + { + foo(b = true, throw new Exception(""), i++); + assert(false); + } + catch (Exception) {} + + assert(b == true); + assert(i == 0); +} + +/// Verify that throws does not screw with dtors +void testThrowDtor() +{ + static struct S + { + __gshared int destructed; + int id; + + ~this() + { + assert(!(destructed & id)); + destructed |= id; + } + + string getMessage() + { + // Force runtime dependency + return destructed ? "Already destructed" : "Valid"; + } + } + + static void fooD(S, int, S) {} + bool caught; + + try + { + fooD(S(1), throw new Exception(S(2).getMessage()), S(4)); + assert(false); + } + catch (Exception e) + { + caught = true; + assert(e.msg == "Valid"); + } + assert(caught); + assert(S.destructed == (1 | 2)); + + + static void fooC(S, int, S) {} + caught = false; + S.destructed = 0; + + try + { + fooC(S(1), throw new Exception(S(2).getMessage()), S(4)); + assert(false); + } + catch (Exception e) + { + caught = true; + assert(e.msg == "Valid"); + } + assert(caught); + assert(S.destructed == (1 | 2)); +} + +/*****************************************/ + int main() { test1(); test2(); test3(); + testThrowExpression(); + testThrowSideEffect(); + testThrowDtor(); return 0; } diff --git a/gcc/testsuite/gdc.test/runnable/test11039.d b/gcc/testsuite/gdc.test/runnable/test11039.d index 8c2e624..cc5cdba 100644 --- a/gcc/testsuite/gdc.test/runnable/test11039.d +++ b/gcc/testsuite/gdc.test/runnable/test11039.d @@ -1,5 +1,5 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test11039b.d import imports.test11039b; diff --git a/gcc/testsuite/gdc.test/runnable/test11239.d b/gcc/testsuite/gdc.test/runnable/test11239.d index 9ace1cf..3420235 100644 --- a/gcc/testsuite/gdc.test/runnable/test11239.d +++ b/gcc/testsuite/gdc.test/runnable/test11239.d @@ -1,6 +1,6 @@ // EXTRA_SOURCES: imports/inc11239.d // REQUIRED_ARGS: -debug -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // PERMUTE_ARGS: import imports.inc11239; diff --git a/gcc/testsuite/gdc.test/runnable/test11447a.d b/gcc/testsuite/gdc.test/runnable/test11447a.d index cced477..b4e7b1f 100644 --- a/gcc/testsuite/gdc.test/runnable/test11447a.d +++ b/gcc/testsuite/gdc.test/runnable/test11447a.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/a11447.d // PERMUTE_ARGS: -allinst diff --git a/gcc/testsuite/gdc.test/runnable/test11447b.d b/gcc/testsuite/gdc.test/runnable/test11447b.d index 1e76da7..5e37a5a 100644 --- a/gcc/testsuite/gdc.test/runnable/test11447b.d +++ b/gcc/testsuite/gdc.test/runnable/test11447b.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/b11447.d // PERMUTE_ARGS: -allinst diff --git a/gcc/testsuite/gdc.test/runnable/test11447c.d b/gcc/testsuite/gdc.test/runnable/test11447c.d index ecec3e5..d3958fe 100644 --- a/gcc/testsuite/gdc.test/runnable/test11447c.d +++ b/gcc/testsuite/gdc.test/runnable/test11447c.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/c11447.d // REQUIRED_ARGS: -w // PERMUTE_ARGS: -allinst -debug -g diff --git a/gcc/testsuite/gdc.test/runnable/test11863.d b/gcc/testsuite/gdc.test/runnable/test11863.d index f6446aa..9039fdb 100644 --- a/gcc/testsuite/gdc.test/runnable/test11863.d +++ b/gcc/testsuite/gdc.test/runnable/test11863.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/std11863conv.d // EXTRA_FILES: imports/std11863bitmanip.d imports/std11863format.d diff --git a/gcc/testsuite/gdc.test/runnable/test14901.d b/gcc/testsuite/gdc.test/runnable/test14901.d index 73a357a..599344a 100644 --- a/gcc/testsuite/gdc.test/runnable/test14901.d +++ b/gcc/testsuite/gdc.test/runnable/test14901.d @@ -1,7 +1,7 @@ // REQUIRED_ARGS: // PERMUTE_ARGS: -unittest // EXTRA_SOURCES: imports/test14901a.d imports/test14901b.d imports/test14901c.d imports/test14901d.d -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: module test14901; diff --git a/gcc/testsuite/gdc.test/runnable/test18868.d b/gcc/testsuite/gdc.test/runnable/test18868.d index b0085c0..26d5c66 100644 --- a/gcc/testsuite/gdc.test/runnable/test18868.d +++ b/gcc/testsuite/gdc.test/runnable/test18868.d @@ -1,5 +1,5 @@ /* -COMPILE_SEPARATELY +COMPILE_SEPARATELY: EXTRA_SOURCES: imports/test18868_a.d imports/test18868_fls.d PERMUTE_ARGS: */ diff --git a/gcc/testsuite/gdc.test/runnable/test27.d b/gcc/testsuite/gdc.test/runnable/test27.d index b45c132..9c0a8d0 100644 --- a/gcc/testsuite/gdc.test/runnable/test27.d +++ b/gcc/testsuite/gdc.test/runnable/test27.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test27a.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/test29.d b/gcc/testsuite/gdc.test/runnable/test29.d index 03c81c6..5ca1eef 100644 --- a/gcc/testsuite/gdc.test/runnable/test29.d +++ b/gcc/testsuite/gdc.test/runnable/test29.d @@ -1,5 +1,5 @@ /* -COMPILE_SEPARATELY +COMPILE_SEPARATELY: EXTRA_SOURCES: imports/test29a.d imports/test29b.d PERMUTE_ARGS: RUN_OUTPUT: diff --git a/gcc/testsuite/gdc.test/runnable/test31.d b/gcc/testsuite/gdc.test/runnable/test31.d index b19366d..ea18104 100644 --- a/gcc/testsuite/gdc.test/runnable/test31.d +++ b/gcc/testsuite/gdc.test/runnable/test31.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test31a.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/test32.d b/gcc/testsuite/gdc.test/runnable/test32.d index 8340ad2..d98d468 100644 --- a/gcc/testsuite/gdc.test/runnable/test32.d +++ b/gcc/testsuite/gdc.test/runnable/test32.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test32a.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/test38.d b/gcc/testsuite/gdc.test/runnable/test38.d index 4c76e9f..b38b9b9 100644 --- a/gcc/testsuite/gdc.test/runnable/test38.d +++ b/gcc/testsuite/gdc.test/runnable/test38.d @@ -1,5 +1,5 @@ /* -COMPILE_SEPARATELY +COMPILE_SEPARATELY: EXTRA_SOURCES: imports/test38a.d PERMUTE_ARGS: RUN_OUTPUT: diff --git a/gcc/testsuite/gdc.test/runnable/test46.d b/gcc/testsuite/gdc.test/runnable/test46.d index 908cafb..f5089a7 100644 --- a/gcc/testsuite/gdc.test/runnable/test46.d +++ b/gcc/testsuite/gdc.test/runnable/test46.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test46b.d imports/test46a.d imports/test46c.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/test49.d b/gcc/testsuite/gdc.test/runnable/test49.d index 641d196..9ef1da4 100644 --- a/gcc/testsuite/gdc.test/runnable/test49.d +++ b/gcc/testsuite/gdc.test/runnable/test49.d @@ -1,5 +1,5 @@ /* -COMPILE_SEPARATELY +COMPILE_SEPARATELY: EXTRA_SOURCES: imports/test49a.d PERMUTE_ARGS: RUN_OUTPUT: diff --git a/gcc/testsuite/gdc.test/runnable/test57.d b/gcc/testsuite/gdc.test/runnable/test57.d index 8c2b662..54cf672 100644 --- a/gcc/testsuite/gdc.test/runnable/test57.d +++ b/gcc/testsuite/gdc.test/runnable/test57.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test57a.d imports/test57b.d // PERMUTE_ARGS: // REQUIRED_ARGS: -inline -release diff --git a/gcc/testsuite/gdc.test/runnable/test7494.d b/gcc/testsuite/gdc.test/runnable/test7494.d index 655d00a..ad9532a 100644 --- a/gcc/testsuite/gdc.test/runnable/test7494.d +++ b/gcc/testsuite/gdc.test/runnable/test7494.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test7494a.d // PERMUTE_ARGS: // REQUIRED_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/test8997.d b/gcc/testsuite/gdc.test/runnable/test8997.d index 9604e12..cc02132 100644 --- a/gcc/testsuite/gdc.test/runnable/test8997.d +++ b/gcc/testsuite/gdc.test/runnable/test8997.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/test8997a.d module test8997; diff --git a/gcc/testsuite/gdc.test/runnable/testmod1.d b/gcc/testsuite/gdc.test/runnable/testmod1.d index 6d9aa9e..43d13d0 100644 --- a/gcc/testsuite/gdc.test/runnable/testmod1.d +++ b/gcc/testsuite/gdc.test/runnable/testmod1.d @@ -1,4 +1,4 @@ -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/testmod1a.d imports/testmod1b.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable/tls_dup.d b/gcc/testsuite/gdc.test/runnable/tls_dup.d index e55f7e5..6acffb4 100644 --- a/gcc/testsuite/gdc.test/runnable/tls_dup.d +++ b/gcc/testsuite/gdc.test/runnable/tls_dup.d @@ -1,7 +1,7 @@ // NOTE: this is a dup of runnable/tls.d strictly to test the same code compiled // separately rather than together like the original is. -// COMPILE_SEPARATELY +// COMPILE_SEPARATELY: // EXTRA_SOURCES: imports/tlsa.d // PERMUTE_ARGS: diff --git a/gcc/testsuite/gdc.test/runnable_cxx/cppa.d b/gcc/testsuite/gdc.test/runnable_cxx/cppa.d index c60d6c6..cd36bf2 100644 --- a/gcc/testsuite/gdc.test/runnable_cxx/cppa.d +++ b/gcc/testsuite/gdc.test/runnable_cxx/cppa.d @@ -9,6 +9,9 @@ // N.B MSVC doesn't have a C++11 switch, but it defaults to the latest fully-supported standard +// Broken for unknown reasons since the OMF => MsCOFF switch +// DISABLED: win32omf + import core.stdc.stdio; import core.stdc.stdarg; import core.stdc.config; diff --git a/gcc/testsuite/gfortran.dg/gomp/depend-4.f90 b/gcc/testsuite/gfortran.dg/gomp/depend-4.f90 new file mode 100644 index 0000000..f6cf2fd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/depend-4.f90 @@ -0,0 +1,261 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-gimple -fdump-tree-original" } + +! Check that 'omp depobj's depend and 'omp task/... depend' depend on +! the same variable + +! For pointers, it depends on the address of the pointer target +! For allocatable, on the allocated memory address + +subroutine foo(dss, dsp, dsa, daa, daaa, daap, doss, dosp, dosa, doaa, doaaa, doaap, & + dssv, dossv) + !use omp_lib + use iso_c_binding, only: c_intptr_t + implicit none (type, external) + integer, parameter :: omp_depend_kind = 2*c_intptr_t + integer :: ss, sp, sa, aa(4), aaa(:), aap(:) + integer :: dss, dsp, dsa, daa(4), daaa(:), daap(:) + integer :: doss, dosp, dosa, doaa(4), doaaa(:), doaap(:) + optional :: doss, dosp, dosa, doaa, doaaa, doaap + allocatable :: sa, aaa, dsa, daaa, dosa, doaaa + pointer :: sp, aap, dsp, daap, dosp, doaap + integer, value :: dssv, dossv + optional :: dossv + + integer(omp_depend_kind) :: object(20) + integer(omp_depend_kind) :: elem(9) + + !$omp depobj(object(1)) depend(in: ss) + !$omp depobj(object(2)) depend(in: sp) + !$omp depobj(object(3)) depend(in: sa) + !$omp depobj(object(4)) depend(in: aa) + !$omp depobj(object(5)) depend(in: aaa) + !$omp depobj(object(6)) depend(in: aap) + !$omp depobj(object(7)) depend(in: dss) + !$omp depobj(object(8)) depend(in: dsp) + !$omp depobj(object(9)) depend(in: dsa) + !$omp depobj(object(10)) depend(in: daa) + !$omp depobj(object(11)) depend(in: daaa) + !$omp depobj(object(12)) depend(in: daap) + !$omp depobj(object(13)) depend(in: doss) + !$omp depobj(object(14)) depend(in: dosp) + !$omp depobj(object(15)) depend(in: dosa) + !$omp depobj(object(16)) depend(in: doaa) + !$omp depobj(object(17)) depend(in: doaaa) + !$omp depobj(object(18)) depend(in: doaap) + !$omp depobj(object(19)) depend(in: dssv) + !$omp depobj(object(20)) depend(in: dossv) + + !$omp depobj(elem(1)) depend(in: aa(2)) + !$omp depobj(elem(2)) depend(in: aaa(2)) + !$omp depobj(elem(3)) depend(in: aap(2)) + !$omp depobj(elem(4)) depend(in: daa(2)) + !$omp depobj(elem(5)) depend(in: daaa(2)) + !$omp depobj(elem(6)) depend(in: daap(2)) + !$omp depobj(elem(6)) depend(in: doaa(2)) + !$omp depobj(elem(8)) depend(in: doaaa(2)) + !$omp depobj(elem(9)) depend(in: doaap(2)) + + !$omp parallel + !$omp single + !$omp task depend(out: ss) + ss = 4 + !$omp end task + !$omp task depend(out: sp) + sp = 4 + !$omp end task + !$omp task depend(out: sa) + sa = 4 + !$omp end task + !$omp task depend(out: aa) + aa = 4 + !$omp end task + !$omp task depend(out: aaa) + aaa = 4 + !$omp end task + !$omp task depend(out: aap) + aap = 4 + !$omp end task + !$omp task depend(out: dss) + dss = 4 + !$omp end task + !$omp task depend(out: dsp) + dsp = 4 + !$omp end task + !$omp task depend(out: dsa) + dsa = 4 + !$omp end task + !$omp task depend(out: daa) + daa = 4 + !$omp end task + !$omp task depend(out: daaa) + daaa = 4 + !$omp end task + !$omp task depend(out: daap) + daap = 4 + !$omp end task + !$omp task depend(out: doss) + doss = 4 + !$omp end task + !$omp task depend(out: dosp) + dosp = 4 + !$omp end task + !$omp task depend(out: dosa) + dosa = 4 + !$omp end task + !$omp task depend(out: doaa) + doaa = 4 + !$omp end task + !$omp task depend(out: doaaa) + doaaa = 4 + !$omp end task + !$omp task depend(out: doaap) + doaap = 4 + !$omp end task + !$omp task depend(out: dossv) + dossv = 4 + !$omp end task + !$omp task depend(out: dssv) + dssv = 4 + !$omp end task + + !$omp task depend(out: aa(2)) + aa(2) = 4 + !$omp end task + !$omp task depend(out: aaa(2)) + aaa(2) = 4 + !$omp end task + !$omp task depend(out: aap(2)) + aap(2) = 4 + !$omp end task + !$omp task depend(out: daa(2)) + daa(2) = 4 + !$omp end task + !$omp task depend(out: daaa(2)) + daaa(2) = 4 + !$omp end task + !$omp task depend(out: daap(2)) + daap(2) = 4 + !$omp end task + !$omp task depend(out: doaa(2)) + doaa(2) = 4 + !$omp end task + !$omp task depend(out: doaaa(2)) + doaaa(2) = 4 + !$omp end task + !$omp task depend(out: doaap(2)) + doaap(2) = 4 + !$omp end task + !$omp end single + !$omp end parallel +end + +subroutine bar + implicit none (type, external) + integer :: depvar, x + + x = 7 + !$omp parallel + !$omp single + !$omp task depend(out: depvar) + x =5 + !$omp end task + !$omp task depend(in: depvar) + if (x /= 5) stop + !$omp end task + !$omp end single + !$omp end parallel +end + +! depvar - only used for dependency, but should still be used in depend: + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:depvar\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(in:depvar\\)" 1 "original" } } + +! { dg-final { scan-tree-dump-times "&object\\\[0\\\] = &ss;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[1\\\] = sp;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[2\\\] = sa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[3\\\] = &aa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[4\\\] = .integer.kind=4.\\\[0:\\\] \\* restrict\\) aaa.data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[5\\\] = .integer.kind=4.\\\[0:\\\] \\*\\) aap.data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[6\\\] = dss;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[7\\\] = \\*dsp;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[8\\\] = \\*dsa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[9\\\] = daa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[10\\\] = .integer.kind=4.\\\[0:\\\] \\* restrict\\) daaa->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[11\\\] = .integer.kind=4.\\\[0:\\\] \\*\\) daap->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[12\\\] = doss;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[13\\\] = \\*dosp;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[14\\\] = \\*dosa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[15\\\] = doaa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[16\\\] = .integer.kind=4.\\\[0:\\\] \\* restrict\\) doaaa->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[17\\\] = .integer.kind=4.\\\[0:\\\] \\*\\) doaap->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[18\\\] = &dssv;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[19\\\] = &dossv;" 1 "original" } } + +! { dg-final { scan-tree-dump-times "&elem\\\[0\\\] = &aa\\\[1\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[1\\\] = &\\(\\*\\(integer.kind=4.\\\[0:\\\] \\* restrict\\) aaa.data\\)\\\[aaa.offset \\+ 2\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[2\\\] = \\(integer.kind=4. \\*\\) \\(aap.data \\+ .sizetype. \\(\\(aap.offset \\+ aap.dim\\\[0\\\].stride \\* 2\\) \\* aap.span\\)\\);" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[3\\\] = &\\(\\*daa\\)\\\[1\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[4\\\] = &\\(\\*\\(integer.kind=4.\\\[0:\\\] \\* restrict\\) daaa->data\\)\\\[daaa->offset \\+ 2\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[5\\\] = \\(integer.kind=4. \\*\\) \\(daap->data \\+ .sizetype. \\(\\(daap->offset \\+ daap->dim\\\[0\\\].stride \\* 2\\) \\* daap->span\\)\\);" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[5\\\] = &\\(\\*doaa\\)\\\[1\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[7\\\] = &\\(\\*\\(integer.kind=4.\\\[0:\\\] \\* restrict\\) doaaa->data\\)\\\[doaaa->offset \\+ 2\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[8\\\] = \\(integer.kind=4. \\*\\) \\(doaap->data \\+ .sizetype. \\(\\(doaap->offset \\+ doaap->dim\\\[0\\\].stride \\* 2\\) \\* doaap->span\\)\\);" 1 "original" } } + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:ss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*sp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*sa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:aa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) aaa.data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\*\\) aap.data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*dss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dsp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dsa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*daa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) daaa->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\*\\) daap->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*doss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dosp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dosa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*doaa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) doaaa->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\*\\) doaap->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:aa\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) aaa.data\\)\\\[aaa.offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\) \\*\\) \\(aap.data \\+ \\(sizetype\\) \\(\\(aap.offset \\+ aap.dim\\\[0\\\].stride \\* 2\\) \\* aap.span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*daa\\)\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) daaa->data\\)\\\[daaa->offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\) \\*\\) \\(daap->data \\+ \\(sizetype\\) \\(\\(daap->offset \\+ daap->dim\\\[0\\\].stride \\* 2\\) \\* daap->span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*doaa\\)\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*\\(integer\\(kind=4\\)\\\[0:\\\] \\* restrict\\) doaaa->data\\)\\\[doaaa->offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(integer\\(kind=4\\) \\*\\) \\(doaap->data \\+ \\(sizetype\\) \\(\\(doaap->offset \\+ doaap->dim\\\[0\\\].stride \\* 2\\) \\* doaap->span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:dossv\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:dssv\\)" 1 "original" } } + + +! gimple dump - check only those which are simple one-line checkable: + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&ss\\) shared\\(ss\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:sp\\) shared\\(sp\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:sa\\) shared\\(sa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&aa\\) shared\\(aa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:dss\\) shared\\(dss\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:daa\\) shared\\(daa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:doss\\) shared\\(doss\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:doaa\\) shared\\(doaa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&aa\\\[1\\\]\\) shared\\(aa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&dossv\\) shared\\(dossv\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&dssv\\) shared\\(dssv\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dsp;" 2 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dsa;" 3 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dosp;" 2 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dosa;" 3 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = doaaa->data;" 4 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = doaap->data;" 4 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = &\\(\\*daa\\)\\\[1\\\];" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = &\\(\\*doaa\\)\\\[1\\\];" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "= &dssv;" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "= &dossv;" 1 "gimple" } } + + diff --git a/gcc/testsuite/gfortran.dg/gomp/depend-5.f90 b/gcc/testsuite/gfortran.dg/gomp/depend-5.f90 new file mode 100644 index 0000000..4cbe3d4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/depend-5.f90 @@ -0,0 +1,82 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-original" } + +! Check that depobj is correctly dereferenced in the depend clause. + +subroutine foo(dss, dsp, dsa, daa, daaa, daap, doss, dosp, dosa, doaa, doaaa, doaap) + !use omp_lib + use iso_c_binding, only: c_intptr_t + implicit none (type, external) + integer, parameter :: omp_depend_kind = 2*c_intptr_t + integer(omp_depend_kind) :: ss, sp, sa, aa(4), aaa(:), aap(:) + integer(omp_depend_kind) :: dss, dsp, dsa, daa(4), daaa(:), daap(:) + integer(omp_depend_kind) :: doss, dosp, dosa, doaa(4), doaaa(:), doaap(:) + optional :: doss, dosp, dosa, doaa, doaaa, doaap + allocatable :: sa, aaa, dsa, daaa, dosa, doaaa + pointer :: sp, aap, dsp, daap, dosp, doaap + + ! Assume the depend types are initialized ... + + !$omp parallel + !$omp single + !$omp task depend(depobj: ss) + !$omp end task + !$omp task depend(depobj: sp) + !$omp end task + !$omp task depend(depobj: sa) + !$omp end task + !$omp task depend(depobj: dss) + !$omp end task + !$omp task depend(depobj: dsp) + !$omp end task + !$omp task depend(depobj: dsa) + !$omp end task + !$omp task depend(depobj: doss) + !$omp end task + !$omp task depend(depobj: dosp) + !$omp end task + !$omp task depend(depobj: dosa) + !$omp end task + + !$omp task depend(depobj: aa(2)) + !$omp end task + !$omp task depend(depobj: aaa(2)) + !$omp end task + !$omp task depend(depobj: aap(2)) + !$omp end task + !$omp task depend(depobj: daa(2)) + !$omp end task + !$omp task depend(depobj: daaa(2)) + !$omp end task + !$omp task depend(depobj: daap(2)) + !$omp end task + !$omp task depend(depobj: doaa(2)) + !$omp end task + !$omp task depend(depobj: doaaa(2)) + !$omp end task + !$omp task depend(depobj: doaap(2)) + !$omp end task + !$omp end single + !$omp end parallel +end + + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:ss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*sp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*sa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*dss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*\\*dsp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*\\*dsa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*doss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*\\*dosp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*\\*dosa\\)" 1 "original" } } + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:aa\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\(\\*\\(integer\\(kind=\[0-9\]+\\)\\\[0:\\\] \\* restrict\\) aaa.data\\)\\\[aaa.offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*\\(integer\\(kind=\[0-9\]+\\) \\*\\) \\(aap.data \\+ \\(sizetype\\) \\(\\(aap.offset \\+ aap.dim\\\[0\\\].stride \\* 2\\) \\* aap.span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\(\\*daa\\)\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\(\\*\\(integer\\(kind=\[0-9\]+\\)\\\[0:\\\] \\* restrict\\) daaa->data\\)\\\[daaa->offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*\\(integer\\(kind=\[0-9\]+\\) \\*\\) \\(daap->data \\+ \\(sizetype\\) \\(\\(daap->offset \\+ daap->dim\\\[0\\\].stride \\* 2\\) \\* daap->span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\(\\*doaa\\)\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\(\\*\\(integer\\(kind=\[0-9\]+\\)\\\[0:\\\] \\* restrict\\) doaaa->data\\)\\\[doaaa->offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(depobj:\\*\\(integer\\(kind=\[0-9\]+\\) \\*\\) \\(doaap->data \\+ \\(sizetype\\) \\(\\(doaap->offset \\+ doaap->dim\\\[0\\\].stride \\* 2\\) \\* doaap->span\\)\\)\\)" 1 "original" } } diff --git a/gcc/testsuite/gfortran.dg/gomp/depend-6.f90 b/gcc/testsuite/gfortran.dg/gomp/depend-6.f90 new file mode 100644 index 0000000..b6c1afe --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/depend-6.f90 @@ -0,0 +1,259 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-gimple -fdump-tree-original" } + +! Check that 'omp depobj's depend and 'omp task/... depend' depend on +! the same variable + +! For pointers, it depends on the address of the pointer target +! For allocatable, on the allocated memory address + +subroutine foo(dss, dsp, dsa, daa, daaa, daap, doss, dosp, dosa, doaa, doaaa, doaap, & + dssv, dossv) + !use omp_lib + use iso_c_binding, only: c_intptr_t, c_ptr, c_null_ptr + implicit none (type, external) + integer, parameter :: omp_depend_kind = 2*c_intptr_t + type(c_ptr) :: ss, sp, sa, aa(4), aaa(:), aap(:) + type(c_ptr) :: dss, dsp, dsa, daa(4), daaa(:), daap(:) + type(c_ptr) :: doss, dosp, dosa, doaa(4), doaaa(:), doaap(:) + optional :: doss, dosp, dosa, doaa, doaaa, doaap + allocatable :: sa, aaa, dsa, daaa, dosa, doaaa + pointer :: sp, aap, dsp, daap, dosp, doaap + type(c_ptr), value :: dssv, dossv + optional :: dossv + + integer(omp_depend_kind) :: object(20) + integer(omp_depend_kind) :: elem(9) + + !$omp depobj(object(1)) depend(in: ss) + !$omp depobj(object(2)) depend(in: sp) + !$omp depobj(object(3)) depend(in: sa) + !$omp depobj(object(4)) depend(in: aa) + !$omp depobj(object(5)) depend(in: aaa) + !$omp depobj(object(6)) depend(in: aap) + !$omp depobj(object(7)) depend(in: dss) + !$omp depobj(object(8)) depend(in: dsp) + !$omp depobj(object(9)) depend(in: dsa) + !$omp depobj(object(10)) depend(in: daa) + !$omp depobj(object(11)) depend(in: daaa) + !$omp depobj(object(12)) depend(in: daap) + !$omp depobj(object(13)) depend(in: doss) + !$omp depobj(object(14)) depend(in: dosp) + !$omp depobj(object(15)) depend(in: dosa) + !$omp depobj(object(16)) depend(in: doaa) + !$omp depobj(object(17)) depend(in: doaaa) + !$omp depobj(object(18)) depend(in: doaap) + !$omp depobj(object(19)) depend(in: dssv) + !$omp depobj(object(20)) depend(in: dossv) + + !$omp depobj(elem(1)) depend(in: aa(2)) + !$omp depobj(elem(2)) depend(in: aaa(2)) + !$omp depobj(elem(3)) depend(in: aap(2)) + !$omp depobj(elem(4)) depend(in: daa(2)) + !$omp depobj(elem(5)) depend(in: daaa(2)) + !$omp depobj(elem(6)) depend(in: daap(2)) + !$omp depobj(elem(6)) depend(in: doaa(2)) + !$omp depobj(elem(8)) depend(in: doaaa(2)) + !$omp depobj(elem(9)) depend(in: doaap(2)) + + !$omp parallel + !$omp single + !$omp task depend(out: ss) + ss = c_null_ptr + !$omp end task + !$omp task depend(out: sp) + sp = c_null_ptr + !$omp end task + !$omp task depend(out: sa) + sa = c_null_ptr + !$omp end task + !$omp task depend(out: aa) + aa = c_null_ptr + !$omp end task + !$omp task depend(out: aaa) + aaa = c_null_ptr + !$omp end task + !$omp task depend(out: aap) + aap = c_null_ptr + !$omp end task + !$omp task depend(out: dss) + dss = c_null_ptr + !$omp end task + !$omp task depend(out: dsp) + dsp = c_null_ptr + !$omp end task + !$omp task depend(out: dsa) + dsa = c_null_ptr + !$omp end task + !$omp task depend(out: daa) + daa = c_null_ptr + !$omp end task + !$omp task depend(out: daaa) + daaa = c_null_ptr + !$omp end task + !$omp task depend(out: daap) + daap = c_null_ptr + !$omp end task + !$omp task depend(out: doss) + doss = c_null_ptr + !$omp end task + !$omp task depend(out: dosp) + dosp = c_null_ptr + !$omp end task + !$omp task depend(out: dosa) + dosa = c_null_ptr + !$omp end task + !$omp task depend(out: doaa) + doaa = c_null_ptr + !$omp end task + !$omp task depend(out: doaaa) + doaaa = c_null_ptr + !$omp end task + !$omp task depend(out: doaap) + doaap = c_null_ptr + !$omp end task + !$omp task depend(out: dossv) + dossv = c_null_ptr + !$omp end task + !$omp task depend(out: dssv) + dssv = c_null_ptr + !$omp end task + + !$omp task depend(out: aa(2)) + aa(2) = c_null_ptr + !$omp end task + !$omp task depend(out: aaa(2)) + aaa(2) = c_null_ptr + !$omp end task + !$omp task depend(out: aap(2)) + aap(2) = c_null_ptr + !$omp end task + !$omp task depend(out: daa(2)) + daa(2) = c_null_ptr + !$omp end task + !$omp task depend(out: daaa(2)) + daaa(2) = c_null_ptr + !$omp end task + !$omp task depend(out: daap(2)) + daap(2) = c_null_ptr + !$omp end task + !$omp task depend(out: doaa(2)) + doaa(2) = c_null_ptr + !$omp end task + !$omp task depend(out: doaaa(2)) + doaaa(2) = c_null_ptr + !$omp end task + !$omp task depend(out: doaap(2)) + doaap(2) = c_null_ptr + !$omp end task + !$omp end single + !$omp end parallel +end + +subroutine bar + implicit none (type, external) + integer :: depvar, x + + x = 7 + !$omp parallel + !$omp single + !$omp task depend(out: depvar) + x =5 + !$omp end task + !$omp task depend(in: depvar) + if (x /= 5) stop + !$omp end task + !$omp end single + !$omp end parallel +end + +! depvar - only used for dependency, but should still be used in depend: + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:depvar\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(in:depvar\\)" 1 "original" } } + +! { dg-final { scan-tree-dump-times "&object\\\[0\\\] = &ss;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[1\\\] = sp;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[2\\\] = sa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[3\\\] = &aa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[4\\\] = .void \\*\\\[0:\\\] \\* restrict\\) aaa.data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[5\\\] = .void \\*\\\[0:\\\] \\*\\) aap.data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[6\\\] = dss;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[7\\\] = \\*dsp;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[8\\\] = \\*dsa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[9\\\] = daa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[10\\\] = .void \\*\\\[0:\\\] \\* restrict\\) daaa->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[11\\\] = .void \\*\\\[0:\\\] \\*\\) daap->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[12\\\] = doss;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[13\\\] = \\*dosp;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[14\\\] = \\*dosa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[15\\\] = doaa;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[16\\\] = .void \\*\\\[0:\\\] \\* restrict\\) doaaa->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[17\\\] = .void \\*\\\[0:\\\] \\*\\) doaap->data;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[18\\\] = &dssv;" 1 "original" } } +! { dg-final { scan-tree-dump-times "&object\\\[19\\\] = &dossv;" 1 "original" } } + +! { dg-final { scan-tree-dump-times "&elem\\\[0\\\] = &aa\\\[1\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[1\\\] = &\\(\\*\\(void \\*\\\[0:\\\] \\* restrict\\) aaa.data\\)\\\[aaa.offset \\+ 2\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[2\\\] = \\(void \\* \\*\\) \\(aap.data \\+ .sizetype. \\(\\(aap.offset \\+ aap.dim\\\[0\\\].stride \\* 2\\) \\* aap.span\\)\\);" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[3\\\] = &\\(\\*daa\\)\\\[1\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[4\\\] = &\\(\\*\\(void \\*\\\[0:\\\] \\* restrict\\) daaa->data\\)\\\[daaa->offset \\+ 2\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[5\\\] = \\(void \\* \\*\\) \\(daap->data \\+ .sizetype. \\(\\(daap->offset \\+ daap->dim\\\[0\\\].stride \\* 2\\) \\* daap->span\\)\\);" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[5\\\] = &\\(\\*doaa\\)\\\[1\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[7\\\] = &\\(\\*\\(void \\*\\\[0:\\\] \\* restrict\\) doaaa->data\\)\\\[doaaa->offset \\+ 2\\\];" 1 "original" } } +! { dg-final { scan-tree-dump-times "&elem\\\[8\\\] = \\(void \\* \\*\\) \\(doaap->data \\+ .sizetype. \\(\\(doaap->offset \\+ doaap->dim\\\[0\\\].stride \\* 2\\) \\* doaap->span\\)\\);" 1 "original" } } + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:ss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*sp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*sa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:aa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\*\\\[0:\\\] \\* restrict\\) aaa.data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\*\\\[0:\\\] \\*\\) aap.data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*dss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dsp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dsa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*daa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\*\\\[0:\\\] \\* restrict\\) daaa->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\*\\\[0:\\\] \\*\\) daap->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*doss\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dosp\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\*dosa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*doaa\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\*\\\[0:\\\] \\* restrict\\) doaaa->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\*\\\[0:\\\] \\*\\) doaap->data\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:aa\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*\\(void \\*\\\[0:\\\] \\* restrict\\) aaa.data\\)\\\[aaa.offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\* \\*\\) \\(aap.data \\+ \\(sizetype\\) \\(\\(aap.offset \\+ aap.dim\\\[0\\\].stride \\* 2\\) \\* aap.span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*daa\\)\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*\\(void \\*\\\[0:\\\] \\* restrict\\) daaa->data\\)\\\[daaa->offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\* \\*\\) \\(daap->data \\+ \\(sizetype\\) \\(\\(daap->offset \\+ daap->dim\\\[0\\\].stride \\* 2\\) \\* daap->span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*doaa\\)\\\[1\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\(\\*\\(void \\*\\\[0:\\\] \\* restrict\\) doaaa->data\\)\\\[doaaa->offset \\+ 2\\\]\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:\\*\\(void \\* \\*\\) \\(doaap->data \\+ \\(sizetype\\) \\(\\(doaap->offset \\+ doaap->dim\\\[0\\\].stride \\* 2\\) \\* doaap->span\\)\\)\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:dossv\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:dssv\\)" 1 "original" } } + + +! gimple dump - check only those which are simple one-line checkable: + +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&ss\\) shared\\(ss\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:sp\\) shared\\(sp\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:sa\\) shared\\(sa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&aa\\) shared\\(aa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:dss\\) shared\\(dss\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:daa\\) shared\\(daa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:doss\\) shared\\(doss\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:doaa\\) shared\\(doaa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&aa\\\[1\\\]\\) shared\\(aa\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&dossv\\) shared\\(dossv\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "#pragma omp task depend\\(out:&dssv\\) shared\\(dssv\\)" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dsp;" 2 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dsa;" 3 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dosp;" 2 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = \\*dosa;" 3 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = doaaa->data;" 4 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = doaap->data;" 4 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = &\\(\\*daa\\)\\\[1\\\];" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "D.\[0-9\]+ = &\\(\\*doaa\\)\\\[1\\\];" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "= &dssv;" 1 "gimple" } } +! { dg-final { scan-tree-dump-times "= &dossv;" 1 "gimple" } } diff --git a/gcc/testsuite/gfortran.dg/pr104211.f90 b/gcc/testsuite/gfortran.dg/pr104211.f90 new file mode 100644 index 0000000..21b0a26 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr104211.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! PR fortran/104211 - ICE in find_array_section +! Contributed by G.Steinmetz + +program p + type t + real :: n + end type + type(t), parameter :: a(3) = [t(2)] ! { dg-error "Different shape" } + type(t), parameter :: b(2) = a(2:3) ! { dg-error "Error in array constructor" } +end diff --git a/gcc/testsuite/gfortran.dg/pr104528.f b/gcc/testsuite/gfortran.dg/pr104528.f new file mode 100644 index 0000000..5b43feb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr104528.f @@ -0,0 +1,44 @@ +! { dg-do compile } +! { dg-options "-O2 -fpeel-loops -ftree-loop-vectorize -fno-tree-scev-cprop --param iv-max-considered-uses=2" } + REAL FUNCTION FOO(M, N, A, W) + + INTEGER M, N + + REAL W(*) + COMPLEX A(*) + + INTEGER II, JI, JJ, KK, LL, MP + + EXTERNAL BAR + + INTEGER QUX + EXTERNAL QUX + + CALL BAR(II) + + IF (M .EQ. 0) THEN + IF (N .EQ. 0) THEN + DO 140 KK = II, II + MP + W(KK) = 0 + 140 CONTINUE + ELSE + KK = II + MP + END IF + + DO 130 JI = KK, KK + MP + DO 120 LL = JJ, JJ + MP + DO 110 KK = II, II + MP + W(KK) = (A(KK)) + 110 CONTINUE + 120 CONTINUE + 130 CONTINUE + + IF (W(KK) .EQ. 0) THEN + FOO = W(QUX(MP, W, 1)) + END IF + + END IF + + RETURN + + END |