Add more tests for MSVC version handling.
authorDavid L. Jones <dlj@google.com>
Wed, 7 Dec 2016 23:39:44 +0000 (23:39 +0000)
committerDavid L. Jones <dlj@google.com>
Wed, 7 Dec 2016 23:39:44 +0000 (23:39 +0000)
Summary:
This change adds more test cases for the default MSVC compatibility version:
 1. When -fms-extensions is supplied, but -fmsc-version and
    -fms-compatibility-version are not.
 2. With the target triple specifies an MSVC environment, but no other
    -fms* flags.

Reviewers: rnk, llvm-commits

Subscribers: hans, compnerd, amccarth

Differential Revision: https://reviews.llvm.org/D27498

llvm-svn: 288997

clang/test/Driver/msc-version.c
clang/test/Driver/msvc-triple.c

index 9246335..ae417e7 100644 (file)
 // CHECK-MSC-15-NOT: "-fmsc-version=150020706"
 // CHECK-MSC-15: "-fms-compatibility-version=15.0.20706"
 
+//
+// Verify default version with -fms-extensions
+//
+
+// RUN: %clang -target i686-windows -fms-extensions -dM -E - </dev/null -o - | FileCheck %s -check-prefix CHECK-MS-EXTENSIONS
+
+// CHECK-MS-EXTENSIONS: _MSC_BUILD 1
+// CHECK-MS-EXTENSIONS: _MSC_FULL_VER {{..}}000000
+// CHECK-MS-EXTENSIONS: _MSC_VER {{..}}00
index cb0c338..42bd02a 100644 (file)
@@ -1,7 +1,9 @@
 // RUN: %clang -target i686-pc-windows-msvc19 -S -emit-llvm %s -o - | FileCheck %s --check-prefix=TARGET-19
 // RUN: %clang -target i686-pc-windows-msvc   -S -emit-llvm %s -o - -fms-compatibility-version=19 | FileCheck %s --check-prefix=OVERRIDE-19
 // RUN: %clang -target i686-pc-windows-msvc-elf -S -emit-llvm %s -o - | FileCheck %s --check-prefix=ELF-DEFAULT
+// RUN: %clang -target i686-pc-windows-msvc   -S -emit-llvm %s -o - | FileCheck %s --check-prefix=DEFAULT
 
 // TARGET-19:   target triple = "i686-pc-windows-msvc19.0.0"
 // OVERRIDE-19: target triple = "i686-pc-windows-msvc19.0.0"
 // ELF-DEFAULT: target triple = "i686-pc-windows-msvc{{.*}}-elf"
+// DEFAULT:     target triple = "i686-pc-windows-msvc{{[^-]+}}"