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