Skip to content

Commit

Permalink
[clang][Interp] Enable existing source_location tests
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D156045
  • Loading branch information
tbaederr committed Sep 6, 2023
1 parent 73b2c86 commit 7e5809e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clang/test/SemaCXX/source_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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__ );
Expand Down

0 comments on commit 7e5809e

Please sign in to comment.