summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-18 16:52:39 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-20 16:51:07 -0300
commit07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (patch)
tree4fba874f6b4245d04a97b5ad8359a2a12ff92545
parent1b821f7388f580ccde7484a223d8dcb881ba65c5 (diff)
downloadgcc-07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1.tar.gz
New tests for parallel compilation feature
Adds new tests for testing the parallel compilation engine. They mainly test issues with regard to symbol promotion clash and incorrect early assembler output. 2020-08-20 Giuliano Belinassi <giuliano.belinassi@usp.br> * gcc.dg/parallel-early-constant.c: New test. * gcc.dg/parallel-static-1.c: New test. * gcc.dg/parallel-static-2.c: New test. * gcc.dg/parallel-static-clash-1.c: New test. * gcc.dg/parallel-static-clash-aux.c: New test.
-rw-r--r--gcc/testsuite/gcc.dg/parallel-early-constant.c22
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-2.c21
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-clash-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/parallel-static-clash-aux.c14
5 files changed, 101 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/parallel-early-constant.c b/gcc/testsuite/gcc.dg/parallel-early-constant.c
new file mode 100644
index 00000000000..fc8c5a986ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-early-constant.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+#define A "This is a long test that tests the structure initialization"
+#define B A,A
+#define C B,B,B,B
+#define D C,C,C,C
+
+const char *foo1 ()
+{
+ return A;
+}
+
+int foo2 ()
+{
+ return 42;
+}
+
+int main()
+{
+ char *subs[]={ D, D, D, D, D, D, D, D, D, D, D, D, D, D, D};
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-1.c b/gcc/testsuite/gcc.dg/parallel-static-1.c
new file mode 100644
index 00000000000..cf1cc7df93d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+static int global_var;
+
+int foo1(void)
+{
+ global_var = 1;
+}
+
+int foo2(void)
+{
+ global_var = 2;
+}
+
+int main ()
+{
+ foo1 ();
+ foo2 ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-2.c b/gcc/testsuite/gcc.dg/parallel-static-2.c
new file mode 100644
index 00000000000..44f5b0d5a02
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+int foo1(void)
+{
+ static int var;
+ var = 1;
+}
+
+int foo2(void)
+{
+ static int var;
+ var = 2;
+}
+
+int main ()
+{
+ foo1 ();
+ foo2 ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-clash-1.c b/gcc/testsuite/gcc.dg/parallel-static-clash-1.c
new file mode 100644
index 00000000000..37a01e28b1b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-clash-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0 --param=promote-statics=1" } */
+/* { dg-additional-sources "parallel-static-clash-aux.c" } */
+
+int file2_c ();
+
+static int __attribute__ ((noinline))
+private ()
+{
+ return 42;
+}
+
+int
+file1_c ()
+{
+ return private ();
+}
+
+int
+main ()
+{
+ return file1_c () + file2_c ();
+}
diff --git a/gcc/testsuite/gcc.dg/parallel-static-clash-aux.c b/gcc/testsuite/gcc.dg/parallel-static-clash-aux.c
new file mode 100644
index 00000000000..aac473933a9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parallel-static-clash-aux.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fparallel-jobs=2 --param=balance-partitions=0" } */
+
+static int __attribute__ ((noinline))
+private ()
+{
+ return -42;
+}
+
+int
+file2_c ()
+{
+ return private ();
+}