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.
This commit is contained in:
Giuliano Belinassi 2020-08-18 16:52:39 -03:00
parent 1b821f7388
commit 07cbaed8ba
5 changed files with 101 additions and 0 deletions

View File

@ -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};
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 ();
}

View File

@ -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 ();
}