]> granicus.if.org Git - clang/commitdiff
Somehow the -fgnu-runtime option itself got lost in all that shuffling.
authorJohn McCall <rjmccall@apple.com>
Wed, 6 Jul 2011 02:36:30 +0000 (02:36 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 6 Jul 2011 02:36:30 +0000 (02:36 +0000)
Restore it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134459 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/gnu-runtime.m [new file with mode: 0644]

index d4d41d28d53eb1cfdefef56053ca951b7e69aa0a..a9f294ffbf79189b897c5d04218a57578d15c637 100644 (file)
@@ -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 (file)
index 0000000..5a3654c
--- /dev/null
@@ -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