blob: befff29527c3f039fff12497bf3e0d8158dc5c05 [file] [log] [blame]
Hans Wennborg6e382812013-08-12 22:19:13 +00001// Don't attempt slash switches on msys bash.
2// REQUIRES: shell-preserves-root
3
4// Note: %s must be preceded by --, otherwise it may be interpreted as a
5// command-line option, e.g. on Mac where %s is commonly under /Users.
6
7// RUN: %clang_cl /Foa -### -- %s 2>&1 | FileCheck -check-prefix=FoNAME %s
8// FoNAME: "-o" "a.obj"
9
10// RUN: %clang_cl /Foa.ext /Fob.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoNAMEEXT %s
11// FoNAMEEXT: warning: overriding '/Foa.ext' option with '/Fob.ext'
12// FoNAMEEXT: "-o" "b.ext"
13
14// RUN: %clang_cl /Fofoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FoDIR %s
15// FoDIR: "-o" "foo.dir{{[/\\]+}}cl-outputs.obj"
16
17// RUN: %clang_cl /Fofoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FoDIRNAME %s
18// FoDIRNAME: "-o" "foo.dir{{[/\\]+}}a.obj"
19
20// RUN: %clang_cl /Fofoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FoDIRNAMEEXT %s
21// FoDIRNAMEEXT: "-o" "foo.dir{{[/\\]+}}a.ext"
22
23// RUN: %clang_cl /Fo.. -### -- %s 2>&1 | FileCheck -check-prefix=FoCRAZY %s
24// FoCRAZY: "-o" "..obj"
25
26// RUN: %clang_cl /Fo -### 2>&1 | FileCheck -check-prefix=FoMISSINGARG %s
27// FoMISSINGARG: error: argument to '/Fo' is missing (expected 1 value)
28
29// RUN: %clang_cl /Foa.obj -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEERROR %s
30// CHECK-MULTIPLESOURCEERROR: error: cannot specify '/Foa.obj' when compiling multiple source files
31
32// RUN: %clang_cl /Fomydir/ -### -- %s %s 2>&1 | FileCheck -check-prefix=CHECK-MULTIPLESOURCEOK %s
33// CHECK-MULTIPLESOURCEOK: "-o" "mydir{{[/\\]+}}cl-outputs.obj"
34
35
36// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTEXE %s
37// DEFAULTEXE: cl-outputs.exe
38
39// RUN: %clang_cl /Fefoo -### -- %s 2>&1 | FileCheck -check-prefix=FeNOEXT %s
40// FeNOEXT: foo.exe
41
42// RUN: %clang_cl /Fefoo.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeEXT %s
43// FeEXT: foo.ext
44
45// RUN: %clang_cl /Fefoo.dir/ -### -- %s 2>&1 | FileCheck -check-prefix=FeDIR %s
46// FeDIR: foo.dir{{[/\\]+}}cl-outputs.exe
47
48// RUN: %clang_cl /Fefoo.dir/a -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAME %s
49// FeDIRNAME: foo.dir{{[/\\]+}}a.exe
50
51// RUN: %clang_cl /Fefoo.dir/a.ext -### -- %s 2>&1 | FileCheck -check-prefix=FeDIRNAMEEXT %s
52// FeDIRNAMEEXT: foo.dir{{[/\\]+}}a.ext
53
54// RUN: %clang_cl /Fe -### 2>&1 | FileCheck -check-prefix=FeMISSINGARG %s
55// FeMISSINGARG: error: argument to '/Fe' is missing (expected 1 value)
56
57// RUN: %clang_cl /Fefoo /Febar -### -- %s 2>&1 | FileCheck -check-prefix=FeOVERRIDE %s
58// FeOVERRIDE: warning: overriding '/Fefoo' option with '/Febar'
59// FeOVERRIDE: bar.exe