Skip to content

Commit

Permalink
[clang][Interp][NFC] Convert test case to verify=expected,ref style
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Feb 16, 2024
1 parent 15cccc5 commit fc38182
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions clang/test/AST/Interp/lambda.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify -std=c++20 %s
// RUN: %clang_cc1 -verify=ref -std=c++20 %s
// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=expected,both -std=c++20 %s
// RUN: %clang_cc1 -verify=ref,both -std=c++20 %s

constexpr int a = 12;
constexpr int f = [c = a]() { return c; }();
Expand Down Expand Up @@ -43,18 +43,15 @@ static_assert(add2(4, 5) == 11);

constexpr int div(int a, int b) {
auto f = [=]() {
return a / b; // expected-note {{division by zero}} \
// ref-note {{division by zero}}
return a / b; // both-note {{division by zero}}
};

return f(); // expected-note {{in call to '&f->operator()()'}} \
// ref-note {{in call to 'f.operator()()'}}
}
static_assert(div(8, 2) == 4);
static_assert(div(8, 0) == 4); // expected-error {{not an integral constant expression}} \
// expected-note {{in call to 'div(8, 0)'}} \
// ref-error {{not an integral constant expression}} \
// ref-note {{in call to 'div(8, 0)'}}
static_assert(div(8, 0) == 4); // both-error {{not an integral constant expression}} \
// both-note {{in call to 'div(8, 0)'}}


struct F {
Expand Down

0 comments on commit fc38182

Please sign in to comment.