[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / CodeGenCXX / always_destroy.cpp
blobca8a8e0cabacb3090252d0fde2234807b2157091
1 // RUN: %clang_cc1 %s -fc++-static-destructors=none -emit-llvm -triple x86_64-apple-macosx10.13.0 -o - | \
2 // RUN: FileCheck --check-prefixes=CHECK,NO-DTORS %s
3 // RUN: %clang_cc1 %s -fc++-static-destructors=thread-local -emit-llvm -triple x86_64-apple-macosx10.13.0 -o - | \
4 // RUN: FileCheck --check-prefixes=CHECK,THREAD-LOCAL-DTORS %s
6 struct NonTrivial {
7 ~NonTrivial();
8 };
10 // CHECK-NOT: __cxa_atexit{{.*}}_ZN10NonTrivialD1Ev
11 NonTrivial nt1;
12 // NO-DTORS-NOT: _tlv_atexit{{.*}}_ZN10NonTrivialD1Ev
13 // THREAD-LOCAL-DTORS: _tlv_atexit{{.*}}_ZN10NonTrivialD1Ev
14 thread_local NonTrivial nt2;
16 struct NonTrivial2 {
17 ~NonTrivial2();
20 // CHECK: __cxa_atexit{{.*}}_ZN11NonTrivial2D1Ev
21 [[clang::always_destroy]] NonTrivial2 nt21;
22 // CHECK: _tlv_atexit{{.*}}_ZN11NonTrivial2D1Ev
23 [[clang::always_destroy]] thread_local NonTrivial2 nt22;
25 void f() {
26 // CHECK: __cxa_atexit{{.*}}_ZN11NonTrivial2D1Ev
27 [[clang::always_destroy]] static NonTrivial2 nt21;
28 // CHECK: _tlv_atexit{{.*}}_ZN11NonTrivial2D1Ev
29 [[clang::always_destroy]] thread_local NonTrivial2 nt22;
32 // CHECK-NOT: __cxa_atexit{{.*}}_ZN10NonTrivialD1Ev
33 [[clang::no_destroy]] NonTrivial nt3;
34 // CHECK-NOT: _tlv_atexit{{.*}}_ZN10NonTrivialD1Ev
35 [[clang::no_destroy]] thread_local NonTrivial nt4;