-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathprebuild.tests.cpp
More file actions
57 lines (53 loc) · 881 Bytes
/
prebuild.tests.cpp
File metadata and controls
57 lines (53 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifdef TEST_CXX11_THREAD
#include <thread>
void g(){}
int main(){
{
std::thread t(g);
t.join();
}
return 0;
}
#elif defined(TEST_PTHREAD)
#include <pthread.h>
void *g(void *) { return 0; }
int main() {
pthread_t inc_x_thread;
if (pthread_create(&inc_x_thread, 0, g, 0))
return 1;
if (pthread_join(inc_x_thread, 0)) {
return 1;
}
return 0;
}
#elif defined(TEST_CXX11_FILESYSTEM)
#include <filesystem>
int main() {
if(std::filesystem::exists("test.txt"))
do {} while(0);
return 0;
}
#elif defined(TEST_CPP17)
#if __cplusplus < 201703L
#error C++17 not supported
#endif
int main() {
return 0;
}
#elif defined(TEST_CPP20)
#if __cplusplus < 202002L
#error C++20 not supported
#endif
int main() {
return 0;
}
#elif defined(TEST_CPP23)
#if __cplusplus < 202302L
#error C++23 not supported
#endif
int main() {
return 0;
}
#else
#error "no TEST specified"
#endif