diff options
author | Jason Merrill <jason@redhat.com> | 2022-11-04 09:47:56 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-11-04 10:08:26 -0400 |
commit | a01c9dfe60764a346ddd82d66d19488d5e9d7927 (patch) | |
tree | 020f82263c995993ea00ab46b3b79fa2a6e3a711 | |
parent | 7817afdb87b92fa3013e4a622ee0a781970ba9b3 (diff) | |
download | gcc-a01c9dfe60764a346ddd82d66d19488d5e9d7927.tar.gz |
test predicate output
-rw-r--r-- | gcc/testsuite/g++.dg/contracts/contracts-multiline1.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec3.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/contracts/contracts15.C | 16 |
3 files changed, 10 insertions, 20 deletions
diff --git a/gcc/testsuite/g++.dg/contracts/contracts-multiline1.C b/gcc/testsuite/g++.dg/contracts/contracts-multiline1.C index e07c4a94d9a..8145c61e827 100644 --- a/gcc/testsuite/g++.dg/contracts/contracts-multiline1.C +++ b/gcc/testsuite/g++.dg/contracts/contracts-multiline1.C @@ -16,4 +16,4 @@ int main(int, char **) ]]; } -// { dg-output "default std::handle_contract_violation called: .*.C 8 main x.*10.*y.*123.*(\n|\r\n|\r)*" } +// { dg-output "default std::handle_contract_violation called: .*.C 8 main x < 10 && y > 123.*(\n|\r\n|\r)*" } diff --git a/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec3.C b/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec3.C index 879172f1513..44725893061 100644 --- a/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec3.C +++ b/gcc/testsuite/g++.dg/contracts/contracts-tmpl-spec3.C @@ -34,12 +34,12 @@ int main(int, char**) { // { dg-output "G5 full double double, f gen R(\n|\r\n|\r)*" } // { dg-output "G5 full double double, f gen R(\n|\r\n|\r)*" } -// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .*(\n|\r\n|\r)*" } -// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .*(\n|\r\n|\r)*" } -// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .*(\n|\r\n|\r)*" } +// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .* t > 0 .*(\n|\r\n|\r)*" } +// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .* s > 0 .*(\n|\r\n|\r)*" } +// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .* r > 0 .*(\n|\r\n|\r)*" } // { dg-output "G5 gen T S, f gen R(\n|\r\n|\r)*" } -// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .*(\n|\r\n|\r)*" } -// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .*(\n|\r\n|\r)*" } -// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .*(\n|\r\n|\r)*" } +// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .* t > 0 .*(\n|\r\n|\r)*" } +// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .* s > 0 .*(\n|\r\n|\r)*" } +// { dg-output "default std::handle_contract_violation called: .*.C 10 G5<int, .* r > 0 .*(\n|\r\n|\r)*" } // { dg-output "G5 gen T S, f gen R(\n|\r\n|\r)*" } diff --git a/gcc/testsuite/g++.dg/contracts/contracts15.C b/gcc/testsuite/g++.dg/contracts/contracts15.C index 35bb5223a70..d822f833916 100644 --- a/gcc/testsuite/g++.dg/contracts/contracts15.C +++ b/gcc/testsuite/g++.dg/contracts/contracts15.C @@ -5,16 +5,6 @@ #include <iostream> #include <experimental/contract> -int -__on_contract_violation (bool continue_, - int line_number, - const char * file_name, - const char * function_name, - const char * comment, - const char * assertion_level, - const char * assertion_role, - int continuation_mode); - void handle_contract_violation(const std::experimental::contract_violation &violation) { std::cerr << "custom std::handle_contract_violation called:" << " " << violation.line_number() @@ -58,9 +48,9 @@ int main(int, char**) { return 0; } -// { dg-output "custom std::handle_contract_violation called: 40 .*/contracts15.C(\n|\r\n|\r)*" } -// { dg-output "synth caught direct: -40(\n|\r\n|\r)*" } -// { dg-output "custom std::handle_contract_violation called: 28 .*/contracts15.C(\n|\r\n|\r)*" } +// { dg-output "custom std::handle_contract_violation called: 30 .*/contracts15.C(\n|\r\n|\r)*" } +// { dg-output "synth caught direct: -30(\n|\r\n|\r)*" } +// { dg-output "custom std::handle_contract_violation called: 18 .*/contracts15.C(\n|\r\n|\r)*" } // { dg-output "terminate called after throwing an instance of .int.(\n|\r\n|\r)*" } // { dg-shouldfail "throwing in noexcept" } |