3d2249215e
2018-02-08 Martin Jambor <mjambor@suse.cz> * testsuite/libgomp.hsa.c/pr82416.c: Make the function with target clonable. From-SVN: r257485
44 lines
634 B
C
44 lines
634 B
C
char __attribute__ ((noipa))
|
|
toup (char X)
|
|
{
|
|
if (X >= 97 && X <= 122)
|
|
return X - 32;
|
|
else
|
|
return X;
|
|
}
|
|
|
|
char
|
|
target_toup_1 (char X)
|
|
{
|
|
char r;
|
|
#pragma omp target map(to:X) map(from:r)
|
|
{
|
|
if (X >= 97 && X <= 122)
|
|
r = X - 32;
|
|
else
|
|
r = X;
|
|
}
|
|
return r;
|
|
}
|
|
|
|
char __attribute__ ((noipa))
|
|
target_toup (char X)
|
|
{
|
|
return target_toup_1 (X);
|
|
}
|
|
|
|
int main (int argc, char **argv)
|
|
{
|
|
char a = 'a';
|
|
if (toup (a) != target_toup (a))
|
|
__builtin_abort ();
|
|
a = 'Z';
|
|
if (toup (a) != target_toup (a))
|
|
__builtin_abort ();
|
|
a = 5;
|
|
if (toup (a) != target_toup (a))
|
|
__builtin_abort ();
|
|
|
|
return 0;
|
|
}
|