In codegen for C++ global destructors, we pass a pointer to the destructor to be called at program exit as the first arg to the `__cxa_atexit` function. If the target's default program AS and default AS are not equal, we need to emit an addrspacecast from the program AS to the generic AS (which is used as the argument type for the first arg of `__cxa_atexit`) in the function call. --------- Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
8 lines
239 B
C++
8 lines
239 B
C++
// RUN: %clang_cc1 -triple spirv64-intel %s -emit-llvm -o - | FileCheck %s
|
|
|
|
// CHECK: all spir_func addrspace(9) i32 @__cxa_atexit(ptr addrspace(4) addrspacecast (ptr addrspace(9) @{{.*}} to ptr addrspace(4)),
|
|
struct S {
|
|
~S() {}
|
|
};
|
|
S s;
|