From: Hans Wennborg Date: Mon, 12 Aug 2013 22:19:13 +0000 (+0000) Subject: clang-cl: Consolidate tests for /Fo and /Fe into cl-outputs.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e382817413f6a3d11f725855cf9c860fb95f052;p=clang clang-cl: Consolidate tests for /Fo and /Fe into cl-outputs.c git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188213 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Driver/cl-Fe.c b/test/Driver/cl-Fe.c deleted file mode 100644 index b1b80a4717..0000000000 --- a/test/Driver/cl-Fe.c +++ /dev/null @@ -1,31 +0,0 @@ -// Don't attempt slash switches on msys bash. -// REQUIRES: shell-preserves-root - -// Note: %s must be preceded by --, otherwise it may be interpreted as a -// command-line option, e.g. on Mac where %s is commonly under /Users. - - -// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTEXE %s -// DEFAULTEXE: cl-Fe.exe - -// RUN: %clang_cl /Fefoo -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXT %s -// FeNOEXT: foo.exe - -// RUN: %clang_cl /Fefoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeEXT %s -// FeEXT: foo.ext - -// RUN: %clang_cl /Fefoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeDIR %s -// FeDIR: foo.dir{{[/\\]+}}cl-Fe.exe - -// RUN: %clang_cl /Fefoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAME %s -// FeDIRNAME: foo.dir{{[/\\]+}}a.exe - -// RUN: %clang_cl /Fefoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEEXT %s -// FeDIRNAMEEXT: foo.dir{{[/\\]+}}a.ext - -// RUN: %clang_cl /Fe -### 2>&1 | FileCheck -check-prefix=MISSINGARG %s -// MISSINGARG: error: argument to '/Fe' is missing (expected 1 value) - -// RUN: %clang_cl /Fefoo /Febar -### -- %s 2>&1 | FileCheck -check-prefix=FEOVERRIDE %s -// FEOVERRIDE: warning: overriding '/Fefoo' option with '/Febar' -// FEOVERRIDE: bar.exe diff --git a/test/Driver/cl-Fo.c b/test/Driver/cl-Fo.c deleted file mode 100644 index e1139247b9..0000000000 --- a/test/Driver/cl-Fo.c +++ /dev/null @@ -1,34 +0,0 @@ -// Don't attempt slash switches on msys bash. -// REQUIRES: shell-preserves-root - -// Note: %s must be preceded by --, otherwise it may be interpreted as a -// command-line option, e.g. on Mac where %s is commonly under /Users. - -// RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-NAME %s -// CHECK-NAME: "-o" "a.obj" - -// RUN: %clang_cl /Foa.ext /Fob.ext -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-NAMEEXT %s -// CHECK-NAMEEXT: warning: overriding '/Foa.ext' option with '/Fob.ext' -// CHECK-NAMEEXT: "-o" "b.ext" - -// RUN: %clang_cl /Fofoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s -// CHECK-DIR: "-o" "foo.dir{{[/\\]+}}cl-Fo.obj" - -// RUN: %clang_cl /Fofoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-DIRNAME %s -// CHECK-DIRNAME: "-o" "foo.dir{{[/\\]+}}a.obj" - -// RUN: %clang_cl /Fofoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-DIRNAMEEXT %s -// CHECK-DIRNAMEEXT: "-o" "foo.dir{{[/\\]+}}a.ext" - -// RUN: %clang_cl /Fo.. -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-CRAZY %s -// CHECK-CRAZY: "-o" "..obj" - - -// RUN: %clang_cl /Fo -### 2>&1 | FileCheck -check-prefix=CHECK-MISSINGARG %s -// CHECK-MISSINGARG: error: argument to '/Fo' is missing (expected 1 value) - -// RUN: %clang_cl /Foa.obj -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEERROR %s -// CHECK-MULTIPLESOURCEERROR: error: cannot specify '/Foa.obj' when compiling multiple source files - -// RUN: %clang_cl /Fomydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEOK %s -// CHECK-MULTIPLESOURCEOK: "-o" "mydir{{[/\\]+}}cl-Fo.obj" diff --git a/test/Driver/cl-outputs.c b/test/Driver/cl-outputs.c new file mode 100644 index 0000000000..befff29527 --- /dev/null +++ b/test/Driver/cl-outputs.c @@ -0,0 +1,59 @@ +// Don't attempt slash switches on msys bash. +// REQUIRES: shell-preserves-root + +// Note: %s must be preceded by --, otherwise it may be interpreted as a +// command-line option, e.g. on Mac where %s is commonly under /Users. + +// RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s +// FoNAME: "-o" "a.obj" + +// RUN: %clang_cl /Foa.ext /Fob.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoNAMEEXT %s +// FoNAMEEXT: warning: overriding '/Foa.ext' option with '/Fob.ext' +// FoNAMEEXT: "-o" "b.ext" + +// RUN: %clang_cl /Fofoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FoDIR %s +// FoDIR: "-o" "foo.dir{{[/\\]+}}cl-outputs.obj" + +// RUN: %clang_cl /Fofoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FoDIRNAME %s +// FoDIRNAME: "-o" "foo.dir{{[/\\]+}}a.obj" + +// RUN: %clang_cl /Fofoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoDIRNAMEEXT %s +// FoDIRNAMEEXT: "-o" "foo.dir{{[/\\]+}}a.ext" + +// RUN: %clang_cl /Fo.. -### -- %s 2>&1 | FileCheck -check-prefix=FoCRAZY %s +// FoCRAZY: "-o" "..obj" + +// RUN: %clang_cl /Fo -### 2>&1 | FileCheck -check-prefix=FoMISSINGARG %s +// FoMISSINGARG: error: argument to '/Fo' is missing (expected 1 value) + +// RUN: %clang_cl /Foa.obj -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEERROR %s +// CHECK-MULTIPLESOURCEERROR: error: cannot specify '/Foa.obj' when compiling multiple source files + +// RUN: %clang_cl /Fomydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEOK %s +// CHECK-MULTIPLESOURCEOK: "-o" "mydir{{[/\\]+}}cl-outputs.obj" + + +// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTEXE %s +// DEFAULTEXE: cl-outputs.exe + +// RUN: %clang_cl /Fefoo -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXT %s +// FeNOEXT: foo.exe + +// RUN: %clang_cl /Fefoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeEXT %s +// FeEXT: foo.ext + +// RUN: %clang_cl /Fefoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeDIR %s +// FeDIR: foo.dir{{[/\\]+}}cl-outputs.exe + +// RUN: %clang_cl /Fefoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAME %s +// FeDIRNAME: foo.dir{{[/\\]+}}a.exe + +// RUN: %clang_cl /Fefoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEEXT %s +// FeDIRNAMEEXT: foo.dir{{[/\\]+}}a.ext + +// RUN: %clang_cl /Fe -### 2>&1 | FileCheck -check-prefix=FeMISSINGARG %s +// FeMISSINGARG: error: argument to '/Fe' is missing (expected 1 value) + +// RUN: %clang_cl /Fefoo /Febar -### -- %s 2>&1 | FileCheck -check-prefix=FeOVERRIDE %s +// FeOVERRIDE: warning: overriding '/Fefoo' option with '/Febar' +// FeOVERRIDE: bar.exe