Hello Everyone,
Attached, please find a patch that will add regression test cases for
elemental function implementation in C.
Here are the Changelog entries:
===
gcc/testsuite/ChangeLog
2012-09-05 Balaji V. Iyer balaji.v.i...@intel.com
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c: New test.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test7.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test8.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test9.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow2.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/switch_stmt.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test1.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test13.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test14.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test15.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test16.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test17.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test18.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test2.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test3.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test4.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test5.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test6.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/elem_fn.exp: New script.
==
Thanking You,
Yours Sincerely,
Balaji V. Iyer.
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c
new file mode 100644
index 000..a33ea3b
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c
@@ -0,0 +1,30 @@
+/* { dg-final { scan-assembler simdsimd } } */
+
+/* This test will insert the clone for the function ef_add inside the function
+ * main (the non-masked version).
+ */
+
+#include stdlib.h
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), processor (pentium_4), uniform
(x,y My_Type ef_add (My_Type x, My_Type y);
+
+My_Type vhx2[10];
+int
+main (int argc, char **argv)
+{
+ My_Type vhx[10];
+ int ii = 9;
+
+ if (argc == 1)
+for (ii = 0; ii 10; ii++)
+ vhx[ii] = argc;
+
+ for (ii = 0; ii 10; ii++)
+vhx2[ii] = ef_add(vhx[ii], vhx[ii]);
+
+ for (ii = 0; ii 10; ii++)
+if (vhx2[ii] != (argc + argc))
+ abort ();
+ return 0;
+}
+
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c
new file mode 100644
index 000..477369e
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c
@@ -0,0 +1,12 @@
+/* { dg-final { scan-assembler simdsimd } } */
+
+/* This test will create 2 clones of the function below,
+ * for the pentium4 with sse3 processor.
+ */
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), processor (pentium_4_sse3), linear(y),
uniform (x
+My_Type ef_add (My_Type x, My_Type y)
+
+{
+ return x + y;
+}
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c
new file mode 100644
index 000..197064b
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c
@@ -0,0 +1,12 @@
+/* { dg-final { scan-assembler simdsimd } } */
+
+/* This test will create 1 clones of the function below, just mask
+ * for the pentium4 processor.
+ */
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), mask, processor (pentium_4_sse3),
linear(y), uniform (x
+My_Type ef_add (My_Type x, My_Type y)
+
+{
+ return x + y;
+}
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c
new file mode 100644
index 000..1c78356
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c
@@ -0,0 +1,12 @@
+/* { dg-final { scan-assembler simdsimd } } */
+
+/* This test will create 1 clones of the function below, just no mask
+ * for the pentium4 with sse3 processor.
+ */
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), nomask, processor (pentium_4_sse3),
linear(y), uniform (x
+My_Type ef_add (My_Type x, My_Type y)
+
+{
+ return x + y;
+}
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test7.c
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test7.c
new file mode 100644
index 000..6720a8c
--- /dev/null