summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fix17751.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fix17751.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fix17751.d22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fix17751.d b/gcc/testsuite/gdc.test/fail_compilation/fix17751.d
new file mode 100644
index 00000000000..11b9c548993
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/fix17751.d
@@ -0,0 +1,22 @@
+/* REQUIRED_ARGS: -m64
+ * TEST_OUTPUT:
+---
+fail_compilation/fix17751.d(15): Error: last parameter to `__simd()` must be a constant
+---
+ */
+
+// https://issues.dlang.org/show_bug.cgi?id=17751
+
+import core.simd;
+
+pure @safe V1 simd(XMM opcode, V1, V2)(V1 op1, V2 op2, ubyte imm8)
+ if (is(V1 == __vector) && is(V2 == __vector))
+{
+ return cast(V1)__simd(opcode, op1, op2, imm8);
+}
+
+void main()
+{
+ float4 a, b;
+ a = simd!(XMM.CMPPD)(a, b, 0x7A);
+}