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
10 // CHECK-NOT: __cxa_atexit{{.*}}_ZN10NonTrivialD1Ev
12 // NO-DTORS-NOT: _tlv_atexit{{.*}}_ZN10NonTrivialD1Ev
13 // THREAD-LOCAL-DTORS: _tlv_atexit{{.*}}_ZN10NonTrivialD1Ev
14 thread_local NonTrivial nt2
;
20 // CHECK: __cxa_atexit{{.*}}_ZN11NonTrivial2D1Ev
21 [[clang::always_destroy
]] NonTrivial2 nt21
;
22 // CHECK: _tlv_atexit{{.*}}_ZN11NonTrivial2D1Ev
23 [[clang::always_destroy
]] thread_local NonTrivial2 nt22
;
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
;