[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / msc-version.c
blobec87e4d41eb4d1b1af130d76e1e72a5ccd4bb03c
1 //
2 // Verify -fms-compatibility-version parsing
3 //
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
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
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
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
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
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
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
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
31 // Verify -fmsc-version and -fms-compatibility-version diagnostic
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
36 // CHECK-BASIC-EXTENDED-DIAGNOSTIC: invalid argument '-fmsc-version={{.*}}' not allowed with '-fms-compatibility-version={{.*}}'
40 // Verify -fmsc-version to -fms-compatibility-version conversion
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
45 // CHECK-MSC-17-NOT: "-fmsc-version=1700"
46 // CHECK-MSC-17: "-fms-compatibility-version=17"
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
50 // CHECK-MSC-16-NOT: "-fmsc-version=1600"
51 // CHECK-MSC-16: "-fms-compatibility-version=16.0"
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
55 // CHECK-MSC-15-NOT: "-fmsc-version=150020706"
56 // CHECK-MSC-15: "-fms-compatibility-version=15.0.20706"
59 // Verify default version with -fms-extensions
62 // RUN: %clang -target i686-windows -fms-extensions -dM -E - </dev/null -o - | FileCheck %s -check-prefix CHECK-MS-EXTENSIONS
64 // CHECK-MS-EXTENSIONS: _MSC_BUILD 1
65 // CHECK-MS-EXTENSIONS: _MSC_FULL_VER {{.+}}
66 // CHECK-MS-EXTENSIONS: _MSC_VER {{....}}