Enable constexpr class members that are device-mapped to not be optimized out.
authorDoru Bercea <doru.bercea@amd.com>
Tue, 21 Mar 2023 18:07:57 +0000 (14:07 -0400)
committerDoru Bercea <doru.bercea@amd.com>
Thu, 23 Mar 2023 14:17:25 +0000 (10:17 -0400)
commit0eabf59528f3c3f64923900cae740d9f26c45ae8
tree61b716882c3ff5b9a6bf74581351afb8305c11e6
parent3ab79124db5e4e1be0b58c4fe43ff01e6fdb3060
Enable constexpr class members that are device-mapped to not be optimized out.

This patch fixes an issue whereby a constexpr class member which is
mapped to the device is being optimized out thus leading to a runtime
error.

Patch: https://reviews.llvm.org/D146552
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/test/OpenMP/declare_target_constexpr_codegen.cpp [new file with mode: 0644]
openmp/libomptarget/test/offloading/target_constexpr_mapping.cpp [new file with mode: 0644]