From b5c809acd34c26666489679300eb0b8a8b824aeb Mon Sep 17 00:00:00 2001 From: Doru Bercea Date: Mon, 19 Dec 2022 07:00:05 -0600 Subject: [PATCH] Fix tests for commit 658ed9547cdd6657895339a6c390c31aa77a5698. --- clang/test/OpenMP/declare_target_messages.cpp | 10 +--------- .../declare_target_nohost_variant_messages.cpp | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/clang/test/OpenMP/declare_target_messages.cpp b/clang/test/OpenMP/declare_target_messages.cpp index bf23813..ed011a8 100644 --- a/clang/test/OpenMP/declare_target_messages.cpp +++ b/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 @@ int MultiDevTy; // expected-warning@+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(); } diff --git a/clang/test/OpenMP/declare_target_nohost_variant_messages.cpp b/clang/test/OpenMP/declare_target_nohost_variant_messages.cpp index b54f864..190c138 100644 --- a/clang/test/OpenMP/declare_target_nohost_variant_messages.cpp +++ b/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(); } -- 2.7.4