diff options
-rw-r--r-- | lib/Driver/Tools.cpp | 6 | ||||
-rw-r--r-- | test/Driver/gnu-runtime.m | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index d4d41d28d5..a9f294ffbf 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1772,10 +1772,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, bool NeXTRuntimeIsDefault = (IsRewriter || getToolChain().getTriple().isOSDarwin()); if (Args.hasFlag(options::OPT_fnext_runtime, options::OPT_fgnu_runtime, - NeXTRuntimeIsDefault)) + NeXTRuntimeIsDefault)) { objCRuntime.setKind(ObjCRuntime::NeXT); - else + } else { + CmdArgs.push_back("-fgnu-runtime"); objCRuntime.setKind(ObjCRuntime::GNU); + } getToolChain().configureObjCRuntime(objCRuntime); if (objCRuntime.HasARC) CmdArgs.push_back("-fobjc-runtime-has-arc"); diff --git a/test/Driver/gnu-runtime.m b/test/Driver/gnu-runtime.m new file mode 100644 index 0000000000..5a3654c8c4 --- /dev/null +++ b/test/Driver/gnu-runtime.m @@ -0,0 +1,5 @@ +// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s +// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x objective-c++ -fsyntax-only -fgnu-runtime %s 2>&1 | FileCheck %s +// CHECK: -fgnu-runtime +// CHECK: -fobjc-runtime-has-arc +// CHECK: -fobjc-runtime-has-weak |