diff options
author | Alexandre Oliva <oliva@adacore.com> | 2024-04-18 08:01:35 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2024-04-18 08:11:51 -0300 |
commit | ce2dfc57b4562fef0d279697d96f672bc903e853 (patch) | |
tree | fc68e7bc7d2f203438bb68583e6b3feded893198 | |
parent | df92df0c19f7783519a392f7ac7d4e617250c328 (diff) | |
download | gcc-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.C | 2 |
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) ]]; |