[clang] 7e5809e - [clang][Interp] Enable existing source_location tests

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 06:06:05 PDT 2023


Author: Timm Bäder
Date: 2023-09-06T15:05:45+02:00
New Revision: 7e5809e7e7bc9a828427b6540a51d45884d8bbbb

URL: https://github.com/llvm/llvm-project/commit/7e5809e7e7bc9a828427b6540a51d45884d8bbbb
DIFF: https://github.com/llvm/llvm-project/commit/7e5809e7e7bc9a828427b6540a51d45884d8bbbb.diff

LOG: [clang][Interp] Enable existing source_location tests

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

Added: 
    

Modified: 
    clang/test/SemaCXX/source_location.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaCXX/source_location.cpp b/clang/test/SemaCXX/source_location.cpp
index 2732700bf4bee3..6dca7cd58612aa 100644
--- a/clang/test/SemaCXX/source_location.cpp
+++ b/clang/test/SemaCXX/source_location.cpp
@@ -3,6 +3,12 @@
 // RUN: %clang_cc1 -std=c++2b -fcxx-exceptions -DUSE_CONSTEVAL -DPAREN_INIT -fexceptions -verify %s
 // RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fms-extensions -DMS -fexceptions -verify %s
 // RUN: %clang_cc1 -std=c++2a -fcxx-exceptions -fms-extensions -DMS -DUSE_CONSTEVAL -fexceptions -verify %s
+//
+/// FIXME: The -DPAREN_INIT one is missing for the new interpreter.
+// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fexceptions -fexperimental-new-constant-interpreter -DNEW_INTERP -verify %s
+// RUN: %clang_cc1 -std=c++2a -fcxx-exceptions -DUSE_CONSTEVAL -fexceptions -fexperimental-new-constant-interpreter -DNEW_INTERP -verify %s
+// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fms-extensions -DMS -fexceptions -fexperimental-new-constant-interpreter -DNEW_INTERP -verify %s
+// RUN: %clang_cc1 -std=c++2a -fcxx-exceptions -fms-extensions -DMS -DUSE_CONSTEVAL -fexceptions -fexperimental-new-constant-interpreter -DNEW_INTERP -verify %s
 // expected-no-diagnostics
 
 #define assert(...) ((__VA_ARGS__) ? ((void)0) : throw 42)
@@ -755,7 +761,7 @@ constexpr int test_init_capture(int a =
                 [b = SL::current().line()] { return b; }()) {
   return a;
 }
-#ifdef USE_CONSTEVAL
+#if defined(USE_CONSTEVAL) && !defined(NEW_INTERP)
 static_assert(test_init_capture() == __LINE__ - 4);
 #else
 static_assert(test_init_capture() == __LINE__ );


        


More information about the cfe-commits mailing list