when compiling the kernel or kexts.
Destructors should be registered with atexit by default only when we are
compiling userland code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331010
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Args.hasFlag(options::OPT_fregister_global_dtors_with_atexit,
options::OPT_fno_register_global_dtors_with_atexit,
- RawTriple.isOSDarwin()))
+ RawTriple.isOSDarwin() && !KernelOrKext))
CmdArgs.push_back("-fregister-global-dtors-with-atexit");
// -fms-extensions=0 is default.
// RUN: FileCheck --check-prefix=WITHATEXIT %s
// RUN: %clang -target x86_64-apple-darwin -c -### %s 2>&1 | \
// RUN: FileCheck --check-prefix=WITHATEXIT %s
+// RUN: %clang -target x86_64-apple-darwin -c -mkernel -### %s 2>&1 | \
+// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
// RUN: %clang -target x86_64-pc-linux-gnu -fregister-global-dtors-with-atexit -fno-register-global-dtors-with-atexit -c -### %s 2>&1 | \
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
// RUN: %clang -target x86_64-pc-linux-gnu -fno-register-global-dtors-with-atexit -fregister-global-dtors-with-atexit -c -### %s 2>&1 | \