[PATCH] D140295: [Fix][OpenMP] Fix commit for nohost variant.

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 05:19:35 PST 2022


doru1004 created this revision.
doru1004 added reviewers: ABataev, carlo.bertolli, ronl.
doru1004 added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
doru1004 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

This fixes the previous commit: 658ed9547cdd6657895339a6c390c31aa77a5698 <https://reviews.llvm.org/rG658ed9547cdd6657895339a6c390c31aa77a5698>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140295

Files:
  clang/test/OpenMP/declare_target_messages.cpp
  clang/test/OpenMP/declare_target_nohost_variant_messages.cpp


Index: clang/test/OpenMP/declare_target_nohost_variant_messages.cpp
===================================================================
--- clang/test/OpenMP/declare_target_nohost_variant_messages.cpp
+++ clang/test/OpenMP/declare_target_nohost_variant_messages.cpp
@@ -1,21 +1,31 @@
+// REQUIRES: amdgpu-registered-target
+
 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-version=52 -DVERBOSE_MODE=1 -verify=omp52 -fnoopenmp-use-tls -ferror-limit 100 -fopenmp-targets=amdgcn-amd-amdhsa -o - %s
 
 void fun();
+void host_function();
+#pragma omp declare target enter(fun) device_type(nohost)
+#pragma omp declare variant(host_function) match(device={kind(host)})
+void fun() {}
+void host_function() {}
+void call_host_function() { fun(); }
+
+void fun1();
 void not_a_host_function();
-#pragma omp declare target enter(fun) device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}}
+#pragma omp declare target enter(fun1) device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}}
 #pragma omp declare variant(not_a_host_function) match(device={kind(host)}) // omp52-error {{function with 'device_type(nohost)' is not available on host}}
-void fun() {}
+void fun1() {}
 #pragma omp begin declare target device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}}
 void not_a_host_function() {}
 #pragma omp end declare target
-void failed_call_to_host_function() { fun(); } // omp52-error {{function with 'device_type(nohost)' is not available on host}}
+void failed_call_to_host_function() { fun1(); } // omp52-error {{function with 'device_type(nohost)' is not available on host}}
 
 void fun2();
-void host_function();
+void host_function2();
 #pragma omp declare target enter(fun2) device_type(nohost)
-#pragma omp declare variant(host_function) match(device={kind(host)})
+#pragma omp declare variant(host_function2) match(device={kind(host)})
 void fun2() {}
 #pragma omp begin declare target device_type(host)
-void host_function() {}
+void host_function2() {}
 #pragma omp end declare target
 void call_to_host_function() { fun2(); }
Index: clang/test/OpenMP/declare_target_messages.cpp
===================================================================
--- clang/test/OpenMP/declare_target_messages.cpp
+++ clang/test/OpenMP/declare_target_messages.cpp
@@ -11,7 +11,7 @@
 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp51 -fopenmp-version=51 -fopenmp-simd -fnoopenmp-use-tls -ferror-limit 100 -o - %s
 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp51 -fopenmp-version=51 -fopenmp-simd -fnoopenmp-use-tls -ferror-limit 100 -o - %s
 
-// RUN: %clang_cc1 -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-version=52 -DVERBOSE_MODE=1 -verify=expected,omp52 -fnoopenmp-use-tls -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp52 -fopenmp -fopenmp-version=52 -DVERBOSE_MODE=1 -fnoopenmp-use-tls -ferror-limit 100 -o - %s
 
 // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp5 -fopenmp -fnoopenmp-use-tls -ferror-limit 100 -o - %s
 #pragma omp end declare target // expected-error {{unexpected OpenMP directive '#pragma omp end declare target'}}
@@ -242,11 +242,3 @@
 // expected-warning at +1 {{expected '#pragma omp end declare target' at end of file to match '#pragma omp begin declare target'}}
 #pragma omp begin declare target
 #endif
-
-void fun();
-void host_function();
-#pragma omp declare target enter(fun) device_type(nohost) // omp45-error {{unexpected 'enter' clause, use 'to' instead}} omp45-error {{expected at least one 'to' or 'link' clause}} omp5-error {{unexpected 'enter' clause, use 'to' instead}} omp5-error {{expected at least one 'to' or 'link' clause}} omp51-error {{expected at least one 'to', 'link' or 'indirect' clause}} omp51-error {{unexpected 'enter' clause, use 'to' instead}}
-#pragma omp declare variant(host_function) match(device={kind(host)})
-void fun() {}
-void host_function() {}
-void call_host_function() { fun(); }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140295.483921.patch
Type: text/x-patch
Size: 4060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221219/bc9e8ef2/attachment.bin>


More information about the cfe-commits mailing list