Skip to content

Commit ec94009

Browse files
author
git apple-llvm automerger
committed
Merge commit '666e37e79cd5' from apple/master into swift/master-next
2 parents 632562d + 666e37e commit ec94009

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,9 @@ void CodeGenModule::AddGlobalCtor(llvm::Function *Ctor, int Priority,
12111211
/// when the module is unloaded.
12121212
void CodeGenModule::AddGlobalDtor(llvm::Function *Dtor, int Priority) {
12131213
if (CodeGenOpts.RegisterGlobalDtorsWithAtExit) {
1214+
if (getCXXABI().useSinitAndSterm())
1215+
llvm::report_fatal_error(
1216+
"register global dtors with atexit() is not supported yet");
12141217
DtorsUsingAtExit[Priority].push_back(Dtor);
12151218
return;
12161219
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: not %clang_cc1 -triple powerpc-ibm-aix-xcoff -S -emit-llvm -x c++ \
2+
// RUN: -fregister-global-dtors-with-atexit < %s 2>&1 | \
3+
// RUN: FileCheck %s
4+
5+
// RUN: not %clang_cc1 -triple powerpc64-ibm-aix-xcoff -S -emit-llvm -x c++ \
6+
// RUN: -fregister-global-dtors-with-atexit < %s 2>&1 | \
7+
// RUN: FileCheck %s
8+
9+
struct T {
10+
T();
11+
~T();
12+
} t;
13+
14+
// CHECK: error in backend: register global dtors with atexit() is not supported yet

clang/test/Driver/cxa-atexit.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,26 @@
3636
// RUN: FileCheck --check-prefix=WITHATEXIT %s
3737
// RUN: %clang -target x86_64-apple-darwin -c -mkernel -### %s 2>&1 | \
3838
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
39+
3940
// RUN: %clang -target x86_64-pc-linux-gnu -fregister-global-dtors-with-atexit -fno-register-global-dtors-with-atexit -c -### %s 2>&1 | \
4041
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
4142
// RUN: %clang -target x86_64-pc-linux-gnu -fno-register-global-dtors-with-atexit -fregister-global-dtors-with-atexit -c -### %s 2>&1 | \
4243
// RUN: FileCheck --check-prefix=WITHATEXIT %s
4344
// RUN: %clang -target x86_64-pc-linux-gnu -c -### %s 2>&1 | \
4445
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
4546

47+
// RUN: %clang -target powerpc-ibm-aix-xcoff -fregister-global-dtors-with-atexit -fno-register-global-dtors-with-atexit -c -### %s 2>&1 | \
48+
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
49+
// RUN: %clang -target powerpc-ibm-aix-xcoff -fno-register-global-dtors-with-atexit -fregister-global-dtors-with-atexit -c -### %s 2>&1 | \
50+
// RUN: FileCheck --check-prefix=WITHATEXIT %s
51+
// RUN: %clang -target powerpc-ibm-aix-xcoff -c -### %s 2>&1 | \
52+
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
53+
// RUN: %clang -target powerpc64-ibm-aix-xcoff -fregister-global-dtors-with-atexit -fno-register-global-dtors-with-atexit -c -### %s 2>&1 | \
54+
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
55+
// RUN: %clang -target powerpc64-ibm-aix-xcoff -fno-register-global-dtors-with-atexit -fregister-global-dtors-with-atexit -c -### %s 2>&1 | \
56+
// RUN: FileCheck --check-prefix=WITHATEXIT %s
57+
// RUN: %clang -target powerpc64-ibm-aix-xcoff -c -### %s 2>&1 | \
58+
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
59+
4660
// WITHATEXIT: -fregister-global-dtors-with-atexit
4761
// WITHOUTATEXIT-NOT: -fregister-global-dtors-with-atexit

0 commit comments

Comments
 (0)