1 // RUN: %libomp-compile-and-run
4 #include "omp_testsuite.h"
5 #include "omp_my_sleep.h"
9 #define ASSERT_CMP(lhs, cmp, rhs) \
10 if (!((lhs)cmp(rhs))) { \
11 printf("Expected: (" #lhs ") " #cmp " (" #rhs "), actual: %e vs. %e", lhs, \
13 return EXIT_FAILURE; \
19 for (i
= 0; i
< NTIMES
; i
++) {
20 double start
= omp_get_wtime(), end
;
21 ASSERT_CMP(start
, >=, 0.0);
22 for (end
= omp_get_wtime(); end
== start
; end
= omp_get_wtime()) {
23 ASSERT_CMP(end
, >=, 0.0);
25 ASSERT_CMP(end
, >=, 0.0);
26 ASSERT_CMP(end
, >, start
);