Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-2_2.c
2023-03-06 14:48:14 +01:00

18 lines
420 B
C

/* { dg-skip-if "" { *-*-* } } */
#pragma acc routine nohost
int f1(int x)
{
/* Make sure this fails host compilation. */
#if defined ACC_DEVICE_TYPE_host
asm ("IT'S A TRAP");
#elif defined ACC_DEVICE_TYPE_nvidia
asm ("{\n\t .reg .u32 %tid_x;\n\t mov.u32 %tid_x, %tid.x;\n\t}");
#elif defined ACC_DEVICE_TYPE_radeon
asm ("s_nop 0");
#else
# error Not ported to this ACC_DEVICE_TYPE
#endif
return 2 * x;
}