1 //
2 // Verify -fms-compatibility-version parsing
3 //
4 
5 // RUN: %clang -target i686-windows -fms-compatibility -fms-compatibility-version=14 -dM -E - </dev/null -o - | FileCheck %s -check-prefix CHECK-MSC-VERSION-MAJOR
6 
7 // CHECK-MSC-VERSION-MAJOR: _MSC_BUILD 1
8 // CHECK-MSC-VERSION-MAJOR: _MSC_FULL_VER 140000000
9 // CHECK-MSC-VERSION-MAJOR: _MSC_VER 1400
10 
11 // RUN: %clang -target i686-windows -fms-compatibility -fms-compatibility-version=15.00 -dM -E - </dev/null -o - | FileCheck %s -check-prefix CHECK-MSC-VERSION-MAJOR-MINOR
12 
13 // CHECK-MSC-VERSION-MAJOR-MINOR: _MSC_BUILD 1
14 // CHECK-MSC-VERSION-MAJOR-MINOR: _MSC_FULL_VER 150000000
15 // CHECK-MSC-VERSION-MAJOR-MINOR: _MSC_VER 1500
16 
17 // RUN: %clang -target i686-windows -fms-compatibility -fms-compatibility-version=15.00.20706 -dM -E - </dev/null -o - | FileCheck %s -check-prefix CHECK-MSC-VERSION-MAJOR-MINOR-BUILD
18 
19 // CHECK-MSC-VERSION-MAJOR-MINOR-BUILD: _MSC_BUILD 1
20 // CHECK-MSC-VERSION-MAJOR-MINOR-BUILD: _MSC_FULL_VER 150020706
21 // CHECK-MSC-VERSION-MAJOR-MINOR-BUILD: _MSC_VER 1500
22 
23 // RUN: %clang -target i686-windows -fms-compatibility -fms-compatibility-version=15.00.20706.01 -dM -E - </dev/null -o - | FileCheck %s -check-prefix CHECK-MSC-VERSION-MAJOR-MINOR-BUILD-PATCH
24 
25 // CHECK-MSC-VERSION-MAJOR-MINOR-BUILD-PATCH: _MSC_BUILD 1
26 // CHECK-MSC-VERSION-MAJOR-MINOR-BUILD-PATCH: _MSC_FULL_VER 150020706
27 // CHECK-MSC-VERSION-MAJOR-MINOR-BUILD-PATCH: _MSC_VER 1500
28 
29 
30 //
31 // Verify -fmsc-version and -fms-compatibility-version diagnostic
32 //
33 
34 // RUN: not %clang -target i686-windows -fms-compatibility -fmsc-version=1700 -fms-compatibility-version=17.00.50727.1 -E - </dev/null 2>&1 | FileCheck %s -check-prefix CHECK-BASIC-EXTENDED-DIAGNOSTIC
35 
36 // CHECK-BASIC-EXTENDED-DIAGNOSTIC: invalid argument '-fmsc-version={{.*}}' not allowed with '-fms-compatibility-version={{.*}}'
37 
38 
39 //
40 // Verify -fmsc-version to -fms-compatibility-version conversion
41 //
42 
43 // RUN: %clang -### -target i686-windows -fms-compatibility -fmsc-version=17 -E - </dev/null -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-MSC-17
44 
45 // CHECK-MSC-17-NOT: "-fmsc-version=1700"
46 // CHECK-MSC-17: "-fms-compatibility-version=17"
47 
48 // RUN: %clang -### -target i686-windows -fms-compatibility -fmsc-version=1600 -E - </dev/null -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-MSC-16
49 
50 // CHECK-MSC-16-NOT: "-fmsc-version=1600"
51 // CHECK-MSC-16: "-fms-compatibility-version=16.0"
52 
53 // RUN: %clang -### -target i686-windows -fms-compatibility -fmsc-version=150020706 -E - </dev/null -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-MSC-15
54 
55 // CHECK-MSC-15-NOT: "-fmsc-version=150020706"
56 // CHECK-MSC-15: "-fms-compatibility-version=15.0.20706"
57 
58 //
59 // Verify default version with -fms-extensions
60 //
61 
62 // RUN: %clang -target i686-windows -fms-extensions -dM -E - </dev/null -o - | FileCheck %s -check-prefix CHECK-MS-EXTENSIONS
63 
64 // CHECK-MS-EXTENSIONS: _MSC_BUILD 1
65 // CHECK-MS-EXTENSIONS: _MSC_FULL_VER {{.+}}
66 // CHECK-MS-EXTENSIONS: _MSC_VER {{....}}
67