diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2019-10-22 13:41:25 -0400 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2019-10-22 16:06:20 -0400 |
commit | 68f5ca4e19c16f12895a6f0b9fbabc1d86c4b6b0 (patch) | |
tree | dbbbee3f58bc3c4434dc32b519e06156d94c59a9 /clang/test/Frontend | |
parent | 4334892e7b077feac3124b789733dbec3380db4c (diff) | |
download | bcm5719-llvm-68f5ca4e19c16f12895a6f0b9fbabc1d86c4b6b0.tar.gz bcm5719-llvm-68f5ca4e19c16f12895a6f0b9fbabc1d86c4b6b0.zip |
[HIP] Add option -fgpu-allow-device-init
Add this option to allow device side class type global variables
with non-trivial ctor/dtor. device side init/fini functions will
be emitted, which will be executed by HIP runtime when
the fat binary is loaded/unloaded.
This feature is to facilitate implementation of device side
sanitizer which requires global vars with non-trival ctors.
By default this option is disabled.
Differential Revision: https://reviews.llvm.org/D69268
Diffstat (limited to 'clang/test/Frontend')
-rw-r--r-- | clang/test/Frontend/warn-device-init-fun.cu | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Frontend/warn-device-init-fun.cu b/clang/test/Frontend/warn-device-init-fun.cu new file mode 100644 index 00000000000..479f3c9377e --- /dev/null +++ b/clang/test/Frontend/warn-device-init-fun.cu @@ -0,0 +1,8 @@ +// REQUIRES: nvptx-registered-target + +// RUN: %clang_cc1 -triple nvptx -fcuda-is-device \ +// RUN: -fgpu-allow-device-init \ +// RUN: %s 2>&1 | FileCheck %s + +// CHECK: warning: '-fgpu-allow-device-init' is ignored since it is only supported for HIP + |