aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2024-04-18 08:01:35 -0300
committerAlexandre Oliva <oliva@gnu.org>2024-04-18 08:11:51 -0300
commitce2dfc57b4562fef0d279697d96f672bc903e853 (patch)
treefc68e7bc7d2f203438bb68583e6b3feded893198
parentdf92df0c19f7783519a392f7ac7d4e617250c328 (diff)
downloadgcc-upstream-ce2dfc57b4562fef0d279697d96f672bc903e853.tar.gz
[c++] [testsuite] adjust contracts9.C for negative addresses
The test expected the address of a literal string, converted to long long, to yield a positive value. That expectation doesn't necessarily hold, and the test fails where it doesn't. Adjust the test to use a pointer that will compare as expected. for gcc/testsuite/ChangeLog * g++.dg/contracts/contracts9.C: Don't assume string literals have non-negative addresses.
-rw-r--r--gcc/testsuite/g++.dg/contracts/contracts9.C2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/contracts/contracts9.C b/gcc/testsuite/g++.dg/contracts/contracts9.C
index 09a1a6532c5..58b60aca320 100644
--- a/gcc/testsuite/g++.dg/contracts/contracts9.C
+++ b/gcc/testsuite/g++.dg/contracts/contracts9.C
@@ -27,7 +27,7 @@ int main()
{
fun1(1, -1);
fun1(-1, 1.0);
- fun1(-1, "test");
+ fun1(-1, (const char *)0x1234);
[[ assert: fun1(-1, -5) ]];
[[ assert: test<int>::fun(10, -6) ]];