[PATCH] D27498: Add more tests for MSVC version handling.

David L. Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 18:08:11 PST 2016


dlj created this revision.
dlj added reviewers: rnk, llvm-commits.
dlj added subscribers: amccarth, compnerd, hans.

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.


https://reviews.llvm.org/D27498

Files:
  test/Driver/msc-version.c
  test/Driver/msvc-triple.c


Index: test/Driver/msvc-triple.c
===================================================================
--- test/Driver/msvc-triple.c
+++ test/Driver/msvc-triple.c
@@ -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{{[^-]+}}"
Index: test/Driver/msc-version.c
===================================================================
--- test/Driver/msc-version.c
+++ test/Driver/msc-version.c
@@ -55,3 +55,12 @@
 // 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27498.80523.patch
Type: text/x-patch
Size: 1512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161207/3b9bc767/attachment.bin>


More information about the llvm-commits mailing list