[llvm-branch-commits] [cfe-branch] r252287 - Merging r248424:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Nov 6 03:38:42 PST 2015


Author: tstellar
Date: Fri Nov  6 05:38:41 2015
New Revision: 252287

URL: http://llvm.org/viewvc/llvm-project?rev=252287&view=rev
Log:
Merging r248424:

------------------------------------------------------------------------
r248424 | joerg | 2015-09-23 16:07:56 -0400 (Wed, 23 Sep 2015) | 3 lines

Push OpenMP linker flags after linker input on Darwin. Don't add any
libraries if -nostdlib is specified. Test.

------------------------------------------------------------------------

Modified:
    cfe/branches/release_37/lib/Driver/Tools.cpp
    cfe/branches/release_37/test/Driver/fopenmp.c

Modified: cfe/branches/release_37/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/lib/Driver/Tools.cpp?rev=252287&r1=252286&r2=252287&view=diff
==============================================================================
--- cfe/branches/release_37/lib/Driver/Tools.cpp (original)
+++ cfe/branches/release_37/lib/Driver/Tools.cpp Fri Nov  6 05:38:41 2015
@@ -6549,8 +6549,6 @@ void darwin::Linker::ConstructJob(Compil
 
   Args.AddAllArgs(CmdArgs, options::OPT_L);
 
-  addOpenMPRuntime(CmdArgs, getToolChain(), Args);
-
   AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
   // Build the input file for -filelist (list of linker input files) in case we
   // need it later
@@ -6569,6 +6567,10 @@ void darwin::Linker::ConstructJob(Compil
     InputFileList.push_back(II.getFilename());
   }
 
+  if (!Args.hasArg(options::OPT_nostdlib) &&
+      !Args.hasArg(options::OPT_nodefaultlibs))
+    addOpenMPRuntime(CmdArgs, getToolChain(), Args);
+
   if (isObjCRuntimeLinked(Args) && !Args.hasArg(options::OPT_nostdlib) &&
       !Args.hasArg(options::OPT_nodefaultlibs)) {
     // We use arclite library for both ARC and subscripting support.

Modified: cfe/branches/release_37/test/Driver/fopenmp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/test/Driver/fopenmp.c?rev=252287&r1=252286&r2=252287&view=diff
==============================================================================
--- cfe/branches/release_37/test/Driver/fopenmp.c (original)
+++ cfe/branches/release_37/test/Driver/fopenmp.c Fri Nov  6 05:38:41 2015
@@ -1,6 +1,9 @@
 // RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
 // RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
 // RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang -target x86_64-apple-darwin -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
+// RUN: %clang -target x86_64-apple-darwin -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP
+// RUN: %clang -target x86_64-apple-darwin -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP
 //
 // CHECK-CC1-OPENMP: "-cc1"
 // CHECK-CC1-OPENMP: "-fopenmp"
@@ -12,6 +15,18 @@
 // RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP
 // RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
 //
+// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
+// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
+// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
+//
+// RUN: %clang -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP
+// RUN: %clang -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP
+// RUN: %clang -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5
+//
+// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP
+// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP
+// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5
+//
 // CHECK-LD-OMP: "{{.*}}ld{{(.exe)?}}"
 // CHECK-LD-OMP: "-lomp"
 //
@@ -21,6 +36,15 @@
 // CHECK-LD-IOMP5: "{{.*}}ld{{(.exe)?}}"
 // CHECK-LD-IOMP5: "-liomp5"
 //
+// CHECK-NO-OMP: "{{.*}}ld{{(.exe)?}}"
+// CHECK-NO-OMP-NOT: "-lomp"
+//
+// CHECK-NO-GOMP: "{{.*}}ld{{(.exe)?}}"
+// CHECK-NO-GOMP-NOT: "-lgomp"
+//
+// CHECK-NO-IOMP5: "{{.*}}ld{{(.exe)?}}"
+// CHECK-NO-IOMP5-NOT: "-liomp5"
+//
 // We'd like to check that the default is sane, but until we have the ability
 // to *always* semantically analyze OpenMP without always generating runtime
 // calls (in the event of an unsupported runtime), we don't have a good way to
@@ -28,6 +52,7 @@
 // OpenMP runtime.
 //
 // RUN: %clang -target x86_64-linux-gnu -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
+// RUN: %clang -target x86_64-darwin -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY
 //
 // CHECK-LD-ANY: "{{.*}}ld{{(.exe)?}}"
 // CHECK-LD-ANY: "-l{{(omp|gomp|iomp5)}}"




More information about the llvm-branch-commits mailing list