mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 23:06:34 +00:00

Increase the range for omp_get_wtick() test to allow for 0.01 (from <0.01). This is needed for NetBSD where it returns exactly that value due to CLOCKS_PER_SEC being 100. This should not cause a significant difference from e.g. FreeBSD where it is 128, and especially from Linux where CLOCKS_PER_SEC is apparently meaningless and sysconf(_SC_CLK_TCK) gives 100 as well. Differential Revision: https://reviews.llvm.org/D55493 llvm-svn: 348857
25 lines
373 B
C
25 lines
373 B
C
// RUN: %libomp-compile-and-run
|
|
#include <stdio.h>
|
|
#include "omp_testsuite.h"
|
|
|
|
int test_omp_get_wtick()
|
|
{
|
|
double tick;
|
|
tick = -1.;
|
|
tick = omp_get_wtick ();
|
|
return ((tick > 0.0) && (tick <= 0.01));
|
|
}
|
|
|
|
int main()
|
|
{
|
|
int i;
|
|
int num_failed=0;
|
|
|
|
for(i = 0; i < REPETITIONS; i++) {
|
|
if(!test_omp_get_wtick()) {
|
|
num_failed++;
|
|
}
|
|
}
|
|
return num_failed;
|
|
}
|