gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr83589.c
Tom de Vries 3dede32b88 [nvptx, PR83589] Workaround for branch-around-nothing JIT bug
2018-01-24  Tom de Vries  <tom@codesourcery.com>

	PR target/83589
	* config/nvptx/nvptx.c (WORKAROUND_PTXJIT_BUG_2): Define to 1.
	(nvptx_pc_set, nvptx_condjump_label): New function. Copy from jump.c.
	Add strict parameter.
	(prevent_branch_around_nothing): Insert dummy insn between branch to
	label and label with no ptx insn inbetween.
	* config/nvptx/nvptx.md (define_insn "fake_nop"): New insn.

	* testsuite/libgomp.oacc-c-c++-common/pr83589.c: New test.

From-SVN: r257016
2018-01-24 13:52:12 +00:00

22 lines
366 B
C

/* { dg-do run } */
/* { dg-set-target-env-var GOMP_NVPTX_JIT "-O0" } */
#define n 32
int
main (void)
{
int arr_a[n];
#pragma acc parallel copyout(arr_a) num_gangs(1) num_workers(1) vector_length(32)
{
#pragma acc loop vector
for (int m = 0; m < 32; m++)
;
#pragma acc loop vector
for (int m = 0; m < 32; m++)
arr_a[m] = 0;
}
}