]> granicus.if.org Git - clang/commitdiff
Reverted r302775
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 11 May 2017 08:25:22 +0000 (08:25 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Thu, 11 May 2017 08:25:22 +0000 (08:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302777 91177308-0d34-0410-b5e6-96231b3b80d8

15 files changed:
lib/Driver/Driver.cpp
test/Driver/aarch64-cpus.c
test/Driver/amdgpu-features.c
test/Driver/arm-darwin-builtin.c [new file with mode: 0644]
test/Driver/arm-default-build-attributes.s
test/Driver/cl-outputs.c
test/Driver/clang_f_opts.c
test/Driver/cuda-external-tools.cu
test/Driver/debug-options.c
test/Driver/gfortran.f90
test/Driver/split-debug.h
test/Driver/unknown-arg.c
test/Index/index-attrs.c
test/Index/index-attrs.cpp
tools/driver/driver.cpp

index ddd100c7897f467c008054b1d761846410ebf4ca..f36deff5d734202c3ec94c9cd38b8fbbd128be71 100644 (file)
@@ -598,8 +598,6 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
   bool CCCPrintPhases;
 
   InputArgList Args = ParseArgStrings(ArgList.slice(1));
-  if (Diags.hasErrorOccurred())
-    return nullptr;
 
   // Silence driver warnings if requested
   Diags.setIgnoreAllWarnings(Args.hasArg(options::OPT_w));
index 4c42e50e42da850a2d087b476e85d4706941514b..554c59d6bcdbaf7fdc8568744351ee15265bc227 100644 (file)
@@ -11,7 +11,7 @@
 // RUN: %clang -target arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
 // RUN: %clang -target arm64 -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
 // RUN: %clang -target arm64 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
-// RUN: %clang -target arm64 -mlittle-endian -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
+// RUN: %clang -target arm64 -mlittle-endian -mcpu-generic -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s
 
 // ARM64-GENERIC: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"
 
index 495cadb119520a67e1f0e9a73a66feaa51f06703..235b88f13bec7b8ab1291e7af25fe87cdcd0d7bb 100644 (file)
@@ -1,7 +1,7 @@
-// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=kaveri -mamdgpu-debugger-abi=0.0 %s -o 2>&1 \
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=kaveri -mamdgpu-debugger-abi=0.0 %s -o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-MAMDGPU-DEBUGGER-ABI-0-0 %s
 // CHECK-MAMDGPU-DEBUGGER-ABI-0-0: the clang compiler does not support '-mamdgpu-debugger-abi=0.0'
 
-// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=kaveri -mamdgpu-debugger-abi=1.0 %s -o 2>&1 \
+// RUN: %clang -### -target amdgcn -x cl -S -emit-llvm -mcpu=kaveri -mamdgpu-debugger-abi=1.0 %s -o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-MAMDGPU-DEBUGGER-ABI-1-0 %s
 // CHECK-MAMDGPU-DEBUGGER-ABI-1-0: "-target-feature" "+amdgpu-debugger-insert-nops" "-target-feature" "+amdgpu-debugger-reserve-regs" "-target-feature" "+amdgpu-debugger-emit-prologue"
diff --git a/test/Driver/arm-darwin-builtin.c b/test/Driver/arm-darwin-builtin.c
new file mode 100644 (file)
index 0000000..be50b68
--- /dev/null
@@ -0,0 +1,14 @@
+// FIXME: Disable pending PR4941.
+// RUX: clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s 2> %t &&
+// RUX: grep -- "-fno-builtin-strcat" %t &&
+// RUX: grep -- "-fno-builtin-strcpy" %t &&
+
+// FIXME: Disable pending PR4941.
+// RUX: clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t &&
+// RUX: not grep -- "-fno-builtin-strcat" %t &&
+// RUX: not grep -- "-fno-builtin-strcpy" %t &&
+
+// RUN: %clang -target x86_64-apple-darwin9 -arch arm -### -fsyntax-only %s -fbuiltin-strcat -fbuiltin-strcpy 2> %t
+// RUN: not grep -- "-fno-builtin-strcat" %t
+// RUN: not grep -- "-fno-builtin-strcpy" %t
+
index be2bf3c77b01f8815b53499b6ef04748095ba612..b651fbb6c9f8e6490b9bcc9788cab32dd531da58 100644 (file)
@@ -10,9 +10,9 @@
 
 // Option ignored C/C++ (since we always emit hardware and ABI build attributes
 // during codegen).
-// RUN: %clang -target armv7--none-eabi -### -x c %s -mdefault-build-attributes 2>&1 \
+// RUN: %clang -target armv7--none-eabi -### -x c %s -mdefault-build-attributes -verify 2>&1 \
 // RUN:    | FileCheck %s -check-prefix CHECK-DISABLED
-// RUN: %clang -target armv7--none-eabi -### -x c++ %s -mdefault-build-attributes 2>&1 \
+// RUN: %clang -target armv7--none-eabi -### -x c++ %s -mdefault-build-attributes -verify 2>&1 \
 // RUN:    | FileCheck %s -check-prefix CHECK-DISABLED
 
 // CHECK-DISABLED-NOT: "-arm-add-build-attributes"
index 6e105e46850dd2d1a3b10a3c30cec4c9166c58ac..d79a577788b9aca33315104acf0479f9b8e06887 100644 (file)
@@ -73,7 +73,7 @@
 // RUN: %clang_cl /c /o .. -### -- %s 2>&1 | FileCheck -check-prefix=oCRAZY2 %s
 // oCRAZY2:  "-o" "..obj"
 
-// RUN: not %clang_cl /c %s -### /o 2>&1 | FileCheck -check-prefix=oMISSINGARG %s
+// RUN: %clang_cl /c %s -### /o 2>&1 | FileCheck -check-prefix=oMISSINGARG %s
 // oMISSINGARG: error: argument to '/o' is missing (expected 1 value)
 
 // RUN: %clang_cl /c /omydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-oMULTIPLESOURCEOK1 %s
 // FeoDIRNAMEEXTDLL: "-out:foo.dir{{[/\\]+}}a.ext"
 // FeoDIRNAMEEXTDLL: "-implib:foo.dir{{[/\\]+}}a.lib"
 
-// RUN: not %clang_cl -### /o 2>&1 | FileCheck -check-prefix=FeoMISSINGARG %s
+// RUN: %clang_cl -### /o 2>&1 | FileCheck -check-prefix=FeoMISSINGARG %s
 // FeoMISSINGARG: error: argument to '/o' is missing (expected 1 value)
 
 // RUN: %clang_cl /ofoo /o bar -### -- %s 2>&1 | FileCheck -check-prefix=FeoOVERRIDE %s
index bad49942a4c47d206acce3f0467236daf0e8cc66..c54c618df1128dd71ae2d1655091d14bcf44f9c4 100644 (file)
 // CHECK-NO-SLP-VECTORIZE-AGG-NOT: "-vectorize-slp-aggressive"
 
 // RUN: %clang -### -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s
-// RUN: not %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s
+// RUN: %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s
 // CHECK-EXTENDED-IDENTIFIERS: "-cc1"
 // CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers"
 // CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers'
index 809b8507683b6aa2eff2512c0fcf8328e9ded1ee..f0f5c154c9778a41046f55be31418237ff5284a2 100644 (file)
@@ -24,8 +24,8 @@
 // RUN: | FileCheck -check-prefix ARCH64 -check-prefix SM20 -check-prefix DBG %s
 
 // --no-cuda-noopt-device-debug overrides --cuda-noopt-device-debug.
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-noopt-device-debug \
-// RUN:   --no-cuda-noopt-device-debug -O2 -c %s 2>&1 \
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-noopt-debug \
+// RUN:   --no-cuda-noopt-debug -O2 -c %s 2>&1 \
 // RUN: | FileCheck -check-prefix ARCH64 -check-prefix SM20 -check-prefix OPT2 %s
 
 // Regular compile without -O.  This should result in us passing -O0 to ptxas.
index b4a2e909b3a3d3f64f347b3494ec8e28e535afcd..74deb414fc56b19c706883fd94a633a7f2834ac1 100644 (file)
@@ -80,7 +80,7 @@
 // RUN: %clang -### -c -gdwarf-2 %s 2>&1 \
 // RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s
 //
-// RUN: not %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_ERR %s
+// RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_NO %s
 // RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
 // RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
 // RUN: %clang -### -c -glldb -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
 // G_PS4: "-dwarf-version=
 // G_PS4: "-generate-arange-section"
 //
-// G_ERR: error: unknown argument:
-//
 // G_NO: "-cc1"
 // G_NO-NOT: -debug-info-kind=
 //
index d2f90b47a39021516371da44a299df42ea64cdf2..e687e51b4df3504ca932fbf42fe5fe40157de5c8 100644 (file)
 ! RUN:     -fsyntax-only \
 ! RUN:     -funderscoring \
 ! RUN:     -fwhole-file \
+! RUN:     -fworking-directory \
 ! RUN:     -imultilib \
 ! RUN:     -iprefix \
 ! RUN:     -iquote \
 ! CHECK: "-fstack-arrays"
 ! CHECK: "-funderscoring"
 ! CHECK: "-fwhole-file"
+! CHECK: "-fworking-directory"
 ! CHECK: "-imultilib"
 ! CHECK: "-iprefix"
 ! CHECK: "-iquote"
index a27ebb2e6f18c3df8ee9f8f26c6a602d6ba9d50f..bb05f30b6754119caac2db404c27e51a3550ae99 100644 (file)
@@ -3,4 +3,13 @@
 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -fmodules -### %s 2> %t
 // RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
 //
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -fmodules -emit-module -fmodules-embed-all-files -fno-implicit-modules -fno-implicit-module-maps -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
+//
+// FIXME: This should fail using clang, except that the type of the output for
+// an object output with modules is given as clang::driver::types::TY_PCH
+// rather than TY_Object.
+// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -fmodules -fmodule-format=obj -### %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
+//
 // CHECK-NO-ACTIONS-NOT: objcopy
index 9bba74a942eb4bd2b302ad3884cb995ee38b7dfe..755d29f1089dae29952b29416836e18da83031c8 100644 (file)
@@ -1,8 +1,8 @@
-// RUN: not %clang %s -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -### 2>&1 | \
+// RUN: %clang %s -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -### 2>&1 | \
 // RUN: FileCheck %s
 // RUN: %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -### -c -- %s 2>&1 | \
 // RUN: FileCheck %s --check-prefix=CL
-// RUN: not %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -c -Werror=unknown-argument -### -- %s 2>&1 | \
+// RUN: %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -c -Werror=unknown-argument -### -- %s 2>&1 | \
 // RUN: FileCheck %s --check-prefix=CL-ERROR
 // RUN: %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -c -Wno-unknown-argument -### -- %s 2>&1 | \
 // RUN: FileCheck %s --check-prefix=SILENT
index a1f1c37faeccdb3a85647a088aff1b246e563b1e..d526721f5b203ae02d2dbb411c1671c8c5856050 100644 (file)
@@ -1,16 +1,16 @@
-// RUN: c-index-test -index-file %s -target armv7-windows-gnu -fdeclspec 2>&1 | FileCheck %s
+// RUN: c-index-test -index-file -check-prefix CHECK %s -target armv7-windows-gnu -fdeclspec
 
 void __declspec(dllexport) export_function(void) {}
-// CHECK: [indexDeclaration]: kind: function | name: export_function | {{.*}} | lang: C
+// CHECK: [indexDeclaraton]: kind: function | name: export_function | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllexport)
 void __attribute__((dllexport)) export_gnu_attribute(void) {}
-// CHECK: [indexDeclaration]: kind: function | name: export_gnu_attribute | {{.*}} | lang: C
+// CHECK: [indexDeclaration] kind: function | name: export_gnu_attribute | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllexport)
 
 void __declspec(dllimport) import_function(void);
-// CHECK: [indexDeclaration]: kind: function | name: import_function | {{.*}} | lang: C
+// CHECK: [indexDeclaration] kind: function | name: import_function | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllimport)
 void __attribute__((dllimport)) import_gnu_attribute(void);
-// CHECK: [indexDeclaration]: kind: function | name: import_gnu_attribute | {{.*}} | lang: C
+// CHECK: [indexDeclaration] kind: function | name: import_gnu_function | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllimport)
 
index 0758a422cab8cee841fec77fd691dbdfba269353..b6100acf880a49aa563f51824cdbd698b0507f87 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: c-index-test -index-file %s -target armv7-windows-gnu -fdeclspec | FileCheck %s
+// RUN: c-index-test -index-file -check-prefix CHECK %s -target armv7-windows-gnu -fdeclspec
 
 struct __declspec(dllexport) export_s {
   void m();
@@ -19,7 +19,7 @@ struct __declspec(dllimport) import_s {
 class __attribute__((dllexport)) export_gnu_s {
   void m();
 };
-// CHECK: [indexDeclaration]: kind: c++-class | name: export_gnu_s | {{.*}} | lang: C++
+// CHECK: [indexDeclaration]: kind: struct | name: export_gnu_s | {{.*}} | lang: C++
 // CHECK: <attribute>: attribute(dllexport)
 // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++
 // CHECK: <attribute>: attribute(dllexport)
@@ -27,24 +27,24 @@ class __attribute__((dllexport)) export_gnu_s {
 class __attribute__((dllimport)) import_gnu_s {
   void m();
 };
-// CHECK: [indexDeclaration]: kind: c++-class | name: import_gnu_s | {{.*}} | lang: C++
+// CHECK: [indexDeclaration]: kind: struct | name: import_gnu_s | {{.*}} | lang: C++
 // CHECK: <attribute>: attribute(dllimport)
 // CHECK: [indexDeclaration]: kind: c++-instance-method | name: m | {{.*}} | lang: C++
 // CHECK: <attribute>: attribute(dllimport)
 
 extern "C" void __declspec(dllexport) export_function(void) {}
-// CHECK: [indexDeclaration]: kind: function | name: export_function | {{.*}} | lang: C
+// CHECK: [indexDeclaraton]: kind: function | name: export_function | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllexport)
 extern "C" void __attribute__((dllexport)) export_gnu_function(void) {}
-// CHECK: [indexDeclaration]: kind: function | name: export_gnu_function | {{.*}} | lang: C
+// CHECK: [indexDeclaraton]: kind: function | name: export_gnu_function | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllexport)
 
 extern "C" {
 void __declspec(dllimport) import_function(void);
-// CHECK: [indexDeclaration]: kind: function | name: import_function | {{.*}} | lang: C
+// CHECK: [indexDeclaration] kind: function | name: import_function | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllimport)
 void __attribute__((dllimport)) import_gnu_function(void);
-// CHECK: [indexDeclaration]: kind: function | name: import_gnu_function | {{.*}} | lang: C
+// CHECK: [indexDeclaration] kind: function | name: import_gnu_function | {{.*}} | lang: C
 // CHECK: <attribute>: attribute(dllimport)
 }
 
index 4bd3b228d0ff6b13142ad7adfea25417bd09f84d..626d006ac0d8498eff19da7eaa9e859435ad5214 100644 (file)
@@ -454,41 +454,40 @@ int main(int argc_, const char **argv_) {
   SetBackdoorDriverOutputsFromEnvVars(TheDriver);
 
   std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(argv));
-  int Res = 1;
-  if (C.get()) {
-    SmallVector<std::pair<int, const Command *>, 4> FailingCommands;
+  int Res = 0;
+  SmallVector<std::pair<int, const Command *>, 4> FailingCommands;
+  if (C.get())
     Res = TheDriver.ExecuteCompilation(*C, FailingCommands);
 
-    // Force a crash to test the diagnostics.
-    if (TheDriver.GenReproducer) {
-      Diags.Report(diag::err_drv_force_crash)
+  // Force a crash to test the diagnostics.
+  if (TheDriver.GenReproducer) {
+    Diags.Report(diag::err_drv_force_crash)
         << !::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH");
 
-      // Pretend that every command failed.
-      FailingCommands.clear();
-      for (const auto &J : C->getJobs())
-        if (const Command *C = dyn_cast<Command>(&J))
-          FailingCommands.push_back(std::make_pair(-1, C));
-    }
+    // Pretend that every command failed.
+    FailingCommands.clear();
+    for (const auto &J : C->getJobs())
+      if (const Command *C = dyn_cast<Command>(&J))
+        FailingCommands.push_back(std::make_pair(-1, C));
+  }
 
-    for (const auto &P : FailingCommands) {
-      int CommandRes = P.first;
-      const Command *FailingCommand = P.second;
-      if (!Res)
-        Res = CommandRes;
-
-      // If result status is < 0, then the driver command signalled an error.
-      // If result status is 70, then the driver command reported a fatal error.
-      // On Windows, abort will return an exit code of 3.  In these cases,
-      // generate additional diagnostic information if possible.
-      bool DiagnoseCrash = CommandRes < 0 || CommandRes == 70;
+  for (const auto &P : FailingCommands) {
+    int CommandRes = P.first;
+    const Command *FailingCommand = P.second;
+    if (!Res)
+      Res = CommandRes;
+
+    // If result status is < 0, then the driver command signalled an error.
+    // If result status is 70, then the driver command reported a fatal error.
+    // On Windows, abort will return an exit code of 3.  In these cases,
+    // generate additional diagnostic information if possible.
+    bool DiagnoseCrash = CommandRes < 0 || CommandRes == 70;
 #ifdef LLVM_ON_WIN32
-      DiagnoseCrash |= CommandRes == 3;
+    DiagnoseCrash |= CommandRes == 3;
 #endif
-      if (DiagnoseCrash) {
-        TheDriver.generateCompilationDiagnostics(*C, *FailingCommand);
-        break;
-      }
+    if (DiagnoseCrash) {
+      TheDriver.generateCompilationDiagnostics(*C, *FailingCommand);
+      break;
     }
   }