sylvestre.ledru updated this revision to Diff 192159.
sylvestre.ledru marked 3 inline comments as done.
sylvestre.ledru edited the summary of this revision.
sylvestre.ledru added a comment.

Improve the test (thanks rnk)


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56803/new/

https://reviews.llvm.org/D56803

Files:
  clang/
  clang/include/
  clang/include/clang/
  clang/include/clang/Format/
  clang/include/clang/Tooling/
  clang/include/clang/Tooling/Inclusions/
  lib/Driver/Driver.cpp
  test/Driver/immediate-options.c


Index: test/Driver/immediate-options.c
===================================================================
--- test/Driver/immediate-options.c
+++ test/Driver/immediate-options.c
@@ -7,7 +7,7 @@
 // HELP-HIDDEN: driver-mode
 
 // RUN: %clang -dumpversion | FileCheck %s -check-prefix=DUMPVERSION
-// DUMPVERSION: 4.2.1
+// DUMPVERSION: {{[0-9]+\.[0-9.]+}}
 
 // RUN: %clang -print-search-dirs | FileCheck %s 
-check-prefix=PRINT-SEARCH-DIRS
 // PRINT-SEARCH-DIRS: programs: ={{.*}}
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -1640,11 +1640,7 @@
   if (C.getArgs().hasArg(options::OPT_dumpversion)) {
     // Since -dumpversion is only implemented for pedantic GCC compatibility, 
we
     // return an answer which matches our definition of __VERSION__.
-    //
-    // If we want to return a more correct answer some day, then we should
-    // introduce a non-pedantically GCC compatible mode to Clang in which we
-    // provide sensible definitions for -dumpversion, __VERSION__, etc.
-    llvm::outs() << "4.2.1\n";
+    llvm::outs() << CLANG_VERSION_STRING << "\n";
     return false;
   }
 


Index: test/Driver/immediate-options.c
===================================================================
--- test/Driver/immediate-options.c
+++ test/Driver/immediate-options.c
@@ -7,7 +7,7 @@
 // HELP-HIDDEN: driver-mode
 
 // RUN: %clang -dumpversion | FileCheck %s -check-prefix=DUMPVERSION
-// DUMPVERSION: 4.2.1
+// DUMPVERSION: {{[0-9]+\.[0-9.]+}}
 
 // RUN: %clang -print-search-dirs | FileCheck %s -check-prefix=PRINT-SEARCH-DIRS
 // PRINT-SEARCH-DIRS: programs: ={{.*}}
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -1640,11 +1640,7 @@
   if (C.getArgs().hasArg(options::OPT_dumpversion)) {
     // Since -dumpversion is only implemented for pedantic GCC compatibility, we
     // return an answer which matches our definition of __VERSION__.
-    //
-    // If we want to return a more correct answer some day, then we should
-    // introduce a non-pedantically GCC compatible mode to Clang in which we
-    // provide sensible definitions for -dumpversion, __VERSION__, etc.
-    llvm::outs() << "4.2.1\n";
+    llvm::outs() << CLANG_VERSION_STRING << "\n";
     return false;
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to