mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 13:46:40 +00:00

CUDA/HIP program may be compiled with -fopenmp. In this case, -fopenmp is only passed to host compilation to take advantages of multi-threads computation. CUDA/HIP and OpenMP both use Sema::DeviceCallGraph to store functions to be analyzed and remove them once they decide the function is sure to be emitted. CUDA/HIP and OpenMP have different functions to determine if a function is sure to be emitted. To check host/device correctly for CUDA/HIP when -fopenmp is enabled, there needs a unified logic to determine whether a function is to be emitted. The logic needs to be aware of both CUDA and OpenMP logic. Differential Revision: https://reviews.llvm.org/D67837 llvm-svn: 374263
15 lines
434 B
Plaintext
15 lines
434 B
Plaintext
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \
|
|
// RUN: -verify -fopenmp %s
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \
|
|
// RUN: -verify -fopenmp -x hip %s
|
|
// expected-no-diagnostics
|
|
|
|
// Tests there is no assertion in Sema::markKnownEmitted when fopenmp is used
|
|
// with CUDA/HIP host compilation.
|
|
|
|
static void f() {}
|
|
|
|
static void g() { f(); }
|
|
|
|
static void h() { g(); }
|