Skip to content

Commit 43401dd

Browse files
authored
[libc++] Make .verify.cpp tests more robust against changing headers (#128703)
This is fixes the tests for the frozen headers, but is an improvement either way.
1 parent 9388e42 commit 43401dd

File tree

11 files changed

+17
-51
lines changed

11 files changed

+17
-51
lines changed

libcxx/test/libcxx/atomics/atomics.syn/compatible_with_stdatomic.compile.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// UNSUPPORTED: no-threads
1010
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
1111

12-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
13-
1412
// This test verifies that <stdatomic.h> redirects to <atomic>.
1513

1614
// Before C++23, <stdatomic.h> can be included after <atomic>, but including it

libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,8 @@
1515

1616
// UNSUPPORTED: no-wide-characters
1717

18-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
19-
2018
#include <fstream>
2119

2220
std::basic_filebuf<char, std::char_traits<wchar_t> > f;
23-
// expected-error-re@streambuf:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
24-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
25-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
26-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
27-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
28-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
29-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
30-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
31-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
32-
// expected-error@fstream:* {{only virtual member functions can be marked 'override'}}
21+
// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
22+
// expected-error@*:* 9 {{only virtual member functions can be marked 'override'}}

libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515

1616
// UNSUPPORTED: no-wide-characters
1717

18-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
19-
2018
#include <fstream>
2119

2220
std::basic_fstream<char, std::char_traits<wchar_t> > f;
23-
// expected-error-re@ios:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
24-
// expected-error-re@streambuf:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
21+
// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
22+
// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
2523

2624
// expected-error@*:* 11 {{only virtual member functions can be marked 'override'}}
2725

libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515

1616
// UNSUPPORTED: no-wide-characters
1717

18-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
19-
2018
#include <istream>
2119
#include <string>
2220

2321
struct test_istream
2422
: public std::basic_istream<char, std::char_traits<wchar_t> > {};
2523

26-
// expected-error-re@ios:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
27-
// expected-error@istream:* {{only virtual member functions can be marked 'override'}}
24+
// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
25+
// expected-error@*:* {{only virtual member functions can be marked 'override'}}

libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515

1616
// UNSUPPORTED: no-wide-characters
1717

18-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
19-
2018
#include <ostream>
2119
#include <string>
2220

2321
struct test_ostream
2422
: public std::basic_ostream<char, std::char_traits<wchar_t> > {};
2523

26-
// expected-error-re@ios:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
24+
// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
2725
// expected-error@*:* {{only virtual member functions can be marked 'override'}}

libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@
1616

1717
// UNSUPPORTED: no-wide-characters
1818

19-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
20-
2119
#include <sstream>
2220

2321
std::basic_stringbuf<char, std::char_traits<wchar_t> > sb;
24-
// expected-error-re@streambuf:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
25-
// expected-error-re@string:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
22+
// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
23+
// expected-error-re@*:* {{static assertion failed{{.*}}traits_type::char_type must be the same type as CharT}}
2624

27-
// expected-error@sstream:* {{only virtual member functions can be marked 'override'}}
28-
// expected-error@sstream:* {{only virtual member functions can be marked 'override'}}
29-
// expected-error@sstream:* {{only virtual member functions can be marked 'override'}}
30-
// expected-error@sstream:* {{only virtual member functions can be marked 'override'}}
31-
// expected-error@sstream:* {{only virtual member functions can be marked 'override'}}
25+
// expected-error@*:* 5 {{only virtual member functions can be marked 'override'}}

libcxx/test/std/containers/sequences/array/array.fill/fill.verify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// void fill(const T& u);
1212

13-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
14-
1513
#include <array>
1614
#include <cassert>
1715

@@ -20,7 +18,7 @@ int main(int, char**) {
2018
typedef double T;
2119
typedef std::array<const T, 0> C;
2220
C c = {};
23-
// expected-error-re@array:* {{static assertion failed{{.*}}cannot fill zero-sized array of type 'const T'}}
21+
// expected-error-re@*:* {{static assertion failed{{.*}}cannot fill zero-sized array of type 'const T'}}
2422
c.fill(5.5); // expected-note {{requested here}}
2523
}
2624

libcxx/test/std/containers/sequences/array/array.swap/swap.verify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// void swap(array& a);
1212

13-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
14-
1513
#include <array>
1614
#include <cassert>
1715

@@ -21,7 +19,7 @@ int main(int, char**) {
2119
typedef std::array<const T, 0> C;
2220
C c = {};
2321
C c2 = {};
24-
// expected-error-re@array:* {{static assertion failed{{.*}}cannot swap zero-sized array of type 'const T'}}
22+
// expected-error-re@*:* {{static assertion failed{{.*}}cannot swap zero-sized array of type 'const T'}}
2523
c.swap(c2); // expected-note {{requested here}}
2624
}
2725

libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
// template <size_t I, class T, size_t N> T& get(array<T, N>& a);
1212

13-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
14-
1513
// Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
1614
// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-array-bounds
1715

@@ -23,5 +21,5 @@ void f() {
2321
typedef std::array<T, 3> C;
2422
C c = {1, 2, 3.5};
2523
std::get<3>(c) = 5.5; // expected-note {{requested here}}
26-
// expected-error-re@array:* {{static assertion failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::get<> (std::array)}}
24+
// expected-error-re@*:* {{static assertion failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::get<> (std::array)}}
2725
}

libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010

1111
// tuple_element<I, array<T, N> >::type
1212

13-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
14-
1513
#include <array>
1614
#include <cassert>
1715

1816
typedef double T;
1917
typedef std::array<T, 3> C;
2018
std::tuple_element<3, C> foo; // expected-note {{requested here}}
21-
// expected-error-re@array:* {{static assertion failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::tuple_element<> (std::array)}}
19+
// expected-error-re@*:* {{static assertion failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::tuple_element<> (std::array)}}

libcxx/test/std/strings/basic.string/char.bad.verify.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// <string>
1010
// ... manipulating sequences of any non-array trivial standard-layout types.
1111

12-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
13-
1412
#include <string>
1513
#include "test_traits.h"
1614

@@ -35,20 +33,20 @@ void f() {
3533
typedef char C[3];
3634
static_assert(std::is_array<C>::value, "");
3735
std::basic_string<C, test_traits<C> > s;
38-
// expected-error-re@string:* {{static assertion failed{{.*}}Character type of basic_string must not be an array}}
36+
// expected-error-re@*:* {{static assertion failed{{.*}}Character type of basic_string must not be an array}}
3937
}
4038

4139
{
4240
// not trivial
4341
static_assert(!std::is_trivial<NotTrivial>::value, "");
4442
std::basic_string<NotTrivial, test_traits<NotTrivial> > s;
45-
// expected-error-re@string:* {{static assertion failed{{.*}}Character type of basic_string must be trivial}}
43+
// expected-error-re@*:* {{static assertion failed{{.*}}Character type of basic_string must be trivial}}
4644
}
4745

4846
{
4947
// not standard layout
5048
static_assert(!std::is_standard_layout<NotStandardLayout>::value, "");
5149
std::basic_string<NotStandardLayout, test_traits<NotStandardLayout> > s;
52-
// expected-error-re@string:* {{static assertion failed{{.*}}Character type of basic_string must be standard-layout}}
50+
// expected-error-re@*:* {{static assertion failed{{.*}}Character type of basic_string must be standard-layout}}
5351
}
5452
}

0 commit comments

Comments
 (0)