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