Use TEST_STD_VER instead of __cplusplus [NFC]
While __cplusplus was only used a few dozen times, TEST_STD_VAR is used more than 2000 times. So we replace the former by the latter for consistency in the tests. There should be no functional change. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@344194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -34,7 +35,7 @@ int main()
|
||||
assert(c.back() == 0);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -32,7 +33,7 @@ int main()
|
||||
assert(c.back() == 0);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -32,7 +33,7 @@ int main()
|
||||
assert(c.front() == 0);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -33,7 +34,7 @@ int main()
|
||||
assert(c[1] == 0);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -34,7 +35,7 @@ int main()
|
||||
assert(c.front() == 0);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -34,7 +35,7 @@ int main()
|
||||
assert(c[0] == 0);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -33,7 +34,7 @@ int main()
|
||||
bool b = c1.begin() < c2.begin();
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -33,7 +34,7 @@ int main()
|
||||
int i = c1.begin() - c2.begin();
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -34,7 +35,7 @@ int main()
|
||||
assert(i[1] == 0);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -36,7 +37,7 @@ int main()
|
||||
i += 2;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -35,7 +36,7 @@ int main()
|
||||
--i;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -35,7 +36,7 @@ int main()
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -33,7 +34,7 @@ int main()
|
||||
T j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef int T;
|
||||
typedef std::vector<T, min_allocator<T>> C;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -36,7 +37,7 @@ int main()
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -34,7 +35,7 @@ int main()
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -34,7 +35,7 @@ int main()
|
||||
++i;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -33,7 +34,7 @@ int main()
|
||||
C::value_type j = *i;
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
|
||||
min_allocator<std::pair<const int, std::string>>> C;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -30,7 +31,7 @@ int main()
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -31,7 +32,7 @@ int main()
|
||||
l1.erase(i);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -30,7 +31,7 @@ int main()
|
||||
std::string::iterator i = l1.erase(l2.cbegin(), l1.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -30,7 +31,7 @@ int main()
|
||||
std::string::iterator i = l1.erase(l1.cbegin(), l2.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -30,7 +31,7 @@ int main()
|
||||
std::string::iterator i = l1.erase(l2.cbegin(), l2.cbegin()+1);
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <exception>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "test_macros.h"
|
||||
#include "min_allocator.h"
|
||||
|
||||
int main()
|
||||
@@ -29,7 +30,7 @@ int main()
|
||||
std::string::iterator i = l1.erase(l1.cbegin()+1, l1.cbegin());
|
||||
assert(false);
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
|
||||
S l1("123");
|
||||
|
||||
@@ -21,11 +21,13 @@
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
std::mutex m;
|
||||
int foo __attribute__((guarded_by(m)));
|
||||
|
||||
static void scoped() {
|
||||
#if __cplusplus >= 201703L
|
||||
#if TEST_STD_VER >= 17
|
||||
std::scoped_lock<std::mutex> lock(m);
|
||||
foo++;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user