aboutsummaryrefslogtreecommitdiff
path: root/test/Driver/cl-inputs.c
blob: 029aeadaec42b78ba12a245cbebdc9e92aca5e94 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// 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 /TC -### -- %s 2>&1 | FileCheck -check-prefix=TC %s
// TC:  "-x" "c"
// TC-NOT: warning
// TC-NOT: note

// RUN: %clang_cl /TP -### -- %s 2>&1 | FileCheck -check-prefix=TP %s
// TP:  "-x" "c++"
// TP-NOT: warning
// TP-NOT: note

// RUN: %clang_cl -### /Tc%s /TP -- %s 2>&1 | FileCheck -check-prefix=Tc %s
// RUN: %clang_cl -### /TP /Tc%s -- %s 2>&1 | FileCheck -check-prefix=Tc %s
// Tc:  "-x" "c"
// Tc:  "-x" "c++"
// Tc-NOT: warning
// Tc-NOT: note

// RUN: %clang_cl -### /Tp%s /TC -- %s 2>&1 | FileCheck -check-prefix=Tp %s
// RUN: %clang_cl -### /TC /Tp%s -- %s 2>&1 | FileCheck -check-prefix=Tp %s
// Tp:  "-x" "c++"
// Tp:  "-x" "c"
// Tp-NOT: warning
// Tp-NOT: note

// RUN: %clang_cl /TP /TC /TP -### -- %s 2>&1 | FileCheck -check-prefix=WARN %s
// WARN: warning: overriding '/TP' option with '/TC'
// WARN: warning: overriding '/TC' option with '/TP'
// WARN: note: The last /TC or /TP option takes precedence over earlier instances
// WARN-NOT: note

// RUN: not %clang_cl - 2>&1 | FileCheck -check-prefix=STDIN %s
// STDIN: error: use /Tc or /Tp

// RUN: %clang_cl -### /Tc - 2>&1 | FileCheck -check-prefix=STDINTc %s
// STDINTc: "-x" "c"

// RUN: env LIB=%S/Inputs/cl-libs %clang_cl -### -- %s cl-test.lib 2>&1 | FileCheck -check-prefix=LIBINPUT %s
// LIBINPUT: link.exe"
// LIBINPUT: "cl-test.lib"

// RUN: env LIB=%S/Inputs/cl-libs %clang_cl -### -- %s cl-test2.lib 2>&1 | FileCheck -check-prefix=LIBINPUT2 %s
// LIBINPUT2: error: no such file or directory: 'cl-test2.lib'
// LIBINPUT2: link.exe"
// LIBINPUT2-NOT: "cl-test2.lib"

void f();