aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.dg
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-02-28 15:47:52 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2022-02-28 17:49:01 +0100
commit1027dc459204894f4503f713a3d73826e4bbab15 (patch)
tree606564b15e0978c77c76d0e618c00c25a78aaf38 /gcc/testsuite/gdc.dg
parent430c89274d7f82810724126637ffdc5507d442f0 (diff)
downloadgcc-1027dc459204894f4503f713a3d73826e4bbab15.zip
gcc-1027dc459204894f4503f713a3d73826e4bbab15.tar.gz
gcc-1027dc459204894f4503f713a3d73826e4bbab15.tar.bz2
d: Merge upstream dmd cf63dd8e5, druntime caf14b0f, phobos 41aaf8c26.
D front-end changes: - Import dmd v2.099.0-rc.1. - The `main' can now return type `noreturn' and supports return inference. D Runtime changes: - Import druntime v2.099.0-rc.1. - C bindings for stat_t on powerpc-linux has been fixed. Phobos changes: - Import phobos v2.099.0-rc.1. gcc/d/ChangeLog: * d-target.cc (Target::_init): Initialize C type size fields. * dmd/MERGE: Merge upstream dmd cf63dd8e5. * dmd/VERSION: Update version to v2.099.0-rc.1. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime caf14b0f. * src/MERGE: Merge upstream phobos 41aaf8c26. gcc/testsuite/ChangeLog: * gdc.dg/torture/simd7413a.d: Update. * gdc.dg/ubsan/pr88957.d: Update. * gdc.dg/simd18489.d: New test. * gdc.dg/torture/simd21727.d: New test.
Diffstat (limited to 'gcc/testsuite/gdc.dg')
-rw-r--r--gcc/testsuite/gdc.dg/simd18489.d8
-rw-r--r--gcc/testsuite/gdc.dg/torture/simd21727.d43
-rw-r--r--gcc/testsuite/gdc.dg/torture/simd7413a.d1
-rw-r--r--gcc/testsuite/gdc.dg/ubsan/pr88957.d3
4 files changed, 53 insertions, 2 deletions
diff --git a/gcc/testsuite/gdc.dg/simd18489.d b/gcc/testsuite/gdc.dg/simd18489.d
new file mode 100644
index 0000000..4591f68
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/simd18489.d
@@ -0,0 +1,8 @@
+// { dg-additional-options "-mavx" { target avx_runtime } }
+// { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+import core.simd;
+
+double dot (double2 a) {
+ return a.ptr[0] * a.ptr[1];
+}
diff --git a/gcc/testsuite/gdc.dg/torture/simd21727.d b/gcc/testsuite/gdc.dg/torture/simd21727.d
new file mode 100644
index 0000000..d277f53
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/torture/simd21727.d
@@ -0,0 +1,43 @@
+// https://issues.dlang.org/show_bug.cgi?id=21727
+// { dg-additional-options "-mavx" { target avx_runtime } }
+// { dg-do run { target { avx_runtime || vect_sizes_16B_8B } } }
+// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
+import core.simd;
+
+@nogc nothrow pure @safe:
+
+struct Float4
+{
+ float4 mVector;
+
+ pragma(inline, false) ref typeof(this) doubleInPlace() return
+ @nogc nothrow pure @safe
+ {
+ mVector = mVector + mVector;
+ return this;
+ }
+}
+
+pragma(inline, false) Float4 identity(Float4 a)
+{
+ return a;
+}
+
+pragma(inline, true) Float4 twoTimes(const ref Float4 a)
+{
+ return Float4(a.mVector + a.mVector);
+}
+
+pragma(inline, false) Float4 fourTimes(const Float4 a)
+{
+ auto x = identity(a);
+ auto y = x.doubleInPlace(); // This crashed in dmd.backend.cgxmm.xmmload.
+ auto z = twoTimes(y);
+ return z;
+}
+
+void main()
+{
+ const c = fourTimes(Float4([5,7,11,13]));
+ assert(c.mVector.array == [20, 28, 44, 52]);
+}
diff --git a/gcc/testsuite/gdc.dg/torture/simd7413a.d b/gcc/testsuite/gdc.dg/torture/simd7413a.d
index 13bd69a..38c9924 100644
--- a/gcc/testsuite/gdc.dg/torture/simd7413a.d
+++ b/gcc/testsuite/gdc.dg/torture/simd7413a.d
@@ -2,7 +2,6 @@
// { dg-additional-options "-mavx" { target avx_runtime } }
// { dg-do run { target { avx_runtime || vect_sizes_16B_8B } } }
// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
-// { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
import core.simd;
void main()
diff --git a/gcc/testsuite/gdc.dg/ubsan/pr88957.d b/gcc/testsuite/gdc.dg/ubsan/pr88957.d
index e6366d4..23433d5 100644
--- a/gcc/testsuite/gdc.dg/ubsan/pr88957.d
+++ b/gcc/testsuite/gdc.dg/ubsan/pr88957.d
@@ -1,5 +1,6 @@
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88957
-// { dg-do compile }
+// { dg-additional-options "-mavx" { target avx_runtime } }
+// { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } }
// { dg-additional-options "-fsanitize=undefined" }
alias int4 = __vector(int[4]);