Debian Codegraph @

libstdc++-v3/testsuite/25_algorithms/lexicographical_compare_three_way/113960.cc

raw
1 // { dg-do run { target c++20 } }
2
3 // PR libstdc++/113960
4 // std::map with std::vector as input overwrites itself with c++20, on s390x
5
6 #include <algorithm>
7 #include <testsuite_hooks.h>
8
9 int main()
10 {
11 unsigned short a1[] { 1, 2, 3 };
12 unsigned short a2[] { 1, 2, 4 };
13 // Incorrect memcmp comparison for big endian targets.
14 VERIFY( std::lexicographical_compare_three_way(a1, a1+3, a2, a2+3) < 0 );
15 }