Hi,

the PR82416 was not actually being compiled into HSAIL because the
function with target region had noclone attribute, which was the
outline function for the region inherited and then the ipa-hsa pass
that clones hitherto shared functions (for both the host and an
hsa accelerator) refused to clone them.

Fixed by rearranging the functions somewhat.  The attribute is
probably actually not necessary now but let's be future-proof.

Martin

2018-02-08  Martin Jambor  <mjam...@suse.cz>

        * testsuite/libgomp.hsa.c/pr82416.c: Make the function with target
        clonable.
---
 libgomp/testsuite/libgomp.hsa.c/pr82416.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libgomp/testsuite/libgomp.hsa.c/pr82416.c 
b/libgomp/testsuite/libgomp.hsa.c/pr82416.c
index b89d421e8f3..40378ab12a5 100644
--- a/libgomp/testsuite/libgomp.hsa.c/pr82416.c
+++ b/libgomp/testsuite/libgomp.hsa.c/pr82416.c
@@ -7,8 +7,8 @@ toup (char X)
     return X;
 }
 
-char __attribute__ ((noipa))
-target_toup (char X)
+char
+target_toup_1 (char X)
 {
   char r;
 #pragma omp target map(to:X) map(from:r)
@@ -21,6 +21,12 @@ target_toup (char X)
   return r;
 }
 
+char __attribute__ ((noipa))
+target_toup (char X)
+{
+  return target_toup_1 (X);
+}
+
 int main (int argc, char **argv)
 {
   char a = 'a';
-- 
2.15.1

Reply via email to