gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/pr95270-1.c
Martin Liska 2aea19bdb1 nvptx: update fix for -Wformat-diag
gcc/ChangeLog:

	* config/nvptx/nvptx.cc (nvptx_goacc_validate_dims_1): Update
	warning messages.

libgomp/ChangeLog:

	* testsuite/libgomp.oacc-c++/privatized-ref-2.C: Update scanning
	patterns.
	* testsuite/libgomp.oacc-c++/privatized-ref-3.C: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/kernels-loop-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pr85486.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/pr95270-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-nohost-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/struct-copyout-1.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/struct-copyout-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/vector-length-64-1.c:
	Likewise.
	* testsuite/libgomp.oacc-fortran/attach-descriptor-1.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/derivedtypes-arrays-1.f90:
	Likewise.
	* testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: Likewise.
	* testsuite/libgomp.oacc-fortran/parallel-dims.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/privatized-ref-1.f95: Likewise.

Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
2022-01-19 08:27:00 +01:00

47 lines
1.2 KiB
C

/* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
#include <assert.h>
#include <openacc.h>
#include <stdint.h>
int
main ()
{
int data;
int *data_p_dev = (int *) acc_create (&data, sizeof data);
int *data_p = &data;
uintptr_t ptrbits;
acc_copyin (&data_p, sizeof data_p);
/* Test attach/detach directives. */
#pragma acc enter data attach(data_p)
#pragma acc serial copyout(ptrbits) /* { dg-warning "using .vector_length \\(32\\)., ignoring 1" "" { target openacc_nvidia_accel_selected } } */
{
ptrbits = (uintptr_t) data_p;
}
#pragma acc exit data detach(data_p)
assert ((void *) ptrbits == data_p_dev);
acc_update_self (&data_p, sizeof data_p);
assert (data_p == &data);
/* Test attach/detach API call. */
acc_attach ((void **) &data_p);
#pragma acc serial copyout(ptrbits) /* { dg-warning "using .vector_length \\(32\\)., ignoring 1" "" { target openacc_nvidia_accel_selected } } */
{
ptrbits = (uintptr_t) data_p;
}
acc_detach ((void **) &data_p);
assert ((void *) ptrbits == data_p_dev);
acc_update_self (&data_p, sizeof data_p);
assert (data_p == &data);
acc_delete (&data_p, sizeof data_p);
acc_delete (&data, sizeof data);
return 0;
}