2020-08-28 03:35:36 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --implicit-check-not='call i32 {@_Z3bazv|@_Z3barv}'
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -emit-pch -o %t
|
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -aux-triple powerpc64le-unknown-unknown -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -o - | FileCheck %s --implicit-check-not='call i32 {@_Z3bazv|@_Z3barv}'
|
2020-06-04 04:32:49 +08:00
|
|
|
// expected-no-diagnostics
|
|
|
|
|
|
|
|
// CHECK-DAG: @_Z3barv
|
|
|
|
// CHECK-DAG: @_Z3bazv
|
2020-12-24 08:16:57 +08:00
|
|
|
// CHECK-DAG: @"_Z53bar$ompvariant$S2$s7$Pnvptx$Pnvptx64$S3$s9$Pmatch_anyv"
|
|
|
|
// CHECK-DAG: @"_Z53baz$ompvariant$S2$s7$Pnvptx$Pnvptx64$S3$s9$Pmatch_anyv"
|
|
|
|
// CHECK-DAG: call i32 @"_Z53bar$ompvariant$S2$s7$Pnvptx$Pnvptx64$S3$s9$Pmatch_anyv"()
|
|
|
|
// CHECK-DAG: call i32 @"_Z53baz$ompvariant$S2$s7$Pnvptx$Pnvptx64$S3$s9$Pmatch_anyv"()
|
2020-06-04 04:32:49 +08:00
|
|
|
|
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
|
|
|
|
#pragma omp declare target
|
|
|
|
|
|
|
|
int bar() { return 1; }
|
|
|
|
|
|
|
|
int baz() { return 5; }
|
|
|
|
|
|
|
|
#pragma omp begin declare variant match(device = {arch(nvptx, nvptx64)}, implementation = {extension(match_any)})
|
|
|
|
|
|
|
|
int bar() { return 2; }
|
|
|
|
|
|
|
|
int baz() { return 6; }
|
|
|
|
|
|
|
|
#pragma omp end declare variant
|
|
|
|
|
|
|
|
#pragma omp end declare target
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int res;
|
|
|
|
#pragma omp target map(from \
|
|
|
|
: res)
|
|
|
|
res = bar() + baz();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2020-12-24 08:16:57 +08:00
|
|
|
#endif
|