blob: f83d1fd7823772a8bd1a5023965648f651895abe [file] [log] [blame]
Hans Wennborg19076102013-07-31 20:51:53 +00001// Don't attempt slash switches on msys bash.
2// REQUIRES: shell-preserves-root
3
Hans Wennborg19076102013-07-31 20:51:53 +00004
Hans Wennborg5762a042013-08-02 00:30:15 +00005// Alias options:
6
7// RUN: %clang_cl /c %s -### 2>&1 | FileCheck -check-prefix=C %s
8// C: -c
9
10// RUN: %clang_cl /Dfoo=bar %s -### 2>&1 | FileCheck -check-prefix=D %s
11// RUN: %clang_cl /D foo=bar %s -### 2>&1 | FileCheck -check-prefix=D %s
12// D: "-D" "foo=bar"
13
14// RTTI is on by default; just check that we don't error.
15// RUN: %clang_cl /Zs /GR %s 2>&1
16
17// RUN: %clang_cl /GR- %s -### 2>&1 | FileCheck -check-prefix=GR_ %s
18// GR_: -fno-rtti
19
20// RUN: %clang_cl /Imyincludedir %s -### 2>&1 | FileCheck -check-prefix=I %s
21// RUN: %clang_cl /I myincludedir %s -### 2>&1 | FileCheck -check-prefix=I %s
22// I: "-I" "myincludedir"
23
24// RUN: %clang_cl /J %s -### 2>&1 | FileCheck -check-prefix=J %s
25// J: -fno-signed-char
26
27// RUN: %clang_cl /Ofoo %s -### 2>&1 | FileCheck -check-prefix=O %s
28// O: -Ofoo
29
30// RUN: %clang_cl /Ob0 %s -### 2>&1 | FileCheck -check-prefix=Ob0 %s
31// Ob0: -fno-inline
32
33// RUN: %clang_cl /Od %s -### 2>&1 | FileCheck -check-prefix=Od %s
34// Od: -O0
35
36// RUN: %clang_cl /Os %s -### 2>&1 | FileCheck -check-prefix=Os %s
37// Os: -Os
38
39// RUN: %clang_cl /Ot %s -### 2>&1 | FileCheck -check-prefix=Ot %s
40// Ot: -O2
41
42// RUN: %clang_cl /Ox %s -### 2>&1 | FileCheck -check-prefix=Ox %s
43// Ox: -O3
44
45// RUN: %clang_cl /Zs /Oy %s 2>&1
46
47// RUN: %clang_cl /Oy- %s -### 2>&1 | FileCheck -check-prefix=Oy_ %s
48// Oy_: -mdisable-fp-elim
49
50// RUN: %clang_cl /P %s -### 2>&1 | FileCheck -check-prefix=P %s
51// P: -E
52
53// RUN: %clang_cl /Umymacro %s -### 2>&1 | FileCheck -check-prefix=U %s
54// RUN: %clang_cl /U mymacro %s -### 2>&1 | FileCheck -check-prefix=U %s
55// U: "-U" "mymacro"
56
57// RUN: %clang_cl /W0 %s -### 2>&1 | FileCheck -check-prefix=W0 %s
58// W0: -w
59
60// RUN: %clang_cl /W1 %s -### 2>&1 | FileCheck -check-prefix=W1 %s
61// RUN: %clang_cl /W2 %s -### 2>&1 | FileCheck -check-prefix=W1 %s
62// RUN: %clang_cl /W3 %s -### 2>&1 | FileCheck -check-prefix=W1 %s
63// RUN: %clang_cl /W4 %s -### 2>&1 | FileCheck -check-prefix=W1 %s
64// RUN: %clang_cl /Wall %s -### 2>&1 | FileCheck -check-prefix=W1 %s
65// W1: -Wall
66
67// RUN: %clang_cl /WX %s -### 2>&1 | FileCheck -check-prefix=WX %s
68// WX: -Werror
69
70// RUN: %clang_cl /WX- %s -### 2>&1 | FileCheck -check-prefix=WX_ %s
71// WX_: -Wno-error
72
73// RUN: %clang_cl /w %s -### 2>&1 | FileCheck -check-prefix=w %s
74// w: -w
75
76// RUN: %clang_cl /Zs %s -### 2>&1 | FileCheck -check-prefix=Zs %s
77// Zs: -fsyntax-only
78
79
80// Ignored options. Check that we don't get "unused during compilation" errors.
81// (/Zs is for syntax-only, /WX is for -Werror)
82// RUN: %clang_cl /Zs /WX /analyze- /errorReport:foo /nologo /Ob1 /Ob2 %s
83// RUN: %clang_cl /Zs /WX /Zc:forScope /Zc:wchar_t %s
84
85
86// Unsupported but parsed options. Check that we don't error on them.
87// (/Zs is for syntax-only)
88// RUN: %clang_cl /Zs /EHsc /Fdfoo /Fobar /fp:precise /Gd /GL /GL- /Gm %s 2>&1
89// RUN: %clang_cl /Zs /Gm- /GS /Gy /Gy- /GZ /MD /MT /MDd /MTd /Oi %s 2>&1
90// RUN: %clang_cl /Zs /RTC1 /Tcfoo /TC /Tpbar /TP /wfoo /Zc:wchar_t- /ZI %s 2>&1
91// RUN: %clang_cl /Zs /Zi /showIncludes %s 2>&1