mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:46:46 +00:00

This change introduces a check-libomp target which is based upon llvm's lit test infrastructure. Each test (generated from the University of Houston's OpenMP testsuite) is compiled and then run. For each test, an exit status of 0 indicates success and non-zero indicates failure. This way, FileCheck is not needed. I've added a bit of logic to generate symlinks (libiomp5 and libgomp) in the build tree so that gcc can be tested as well. When building out-of- tree builds, the user will have to provide llvm-lit either by specifying -DLIBOMP_LLVM_LIT_EXECUTABLE or having llvm-lit in their PATH. Differential Revision: http://reviews.llvm.org/D11821 llvm-svn: 248211
34 lines
693 B
C
34 lines
693 B
C
#ifndef MY_SLEEP_H
|
|
#define MY_SLEEP_H
|
|
|
|
/*! Utility function to have a sleep function with better resolution and
|
|
* which only stops one thread. */
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <errno.h>
|
|
#include <time.h>
|
|
|
|
#if defined(_WIN32)
|
|
# include <windows.h>
|
|
// Windows version of my_sleep() function
|
|
static void my_sleep(double sleeptime) {
|
|
DWORD ms = (DWORD) (sleeptime * 1000.0);
|
|
Sleep(ms);
|
|
}
|
|
|
|
|
|
#else // _WIN32
|
|
|
|
// Unices version of my_sleep() function
|
|
static void my_sleep(double sleeptime) {
|
|
struct timespec ts;
|
|
ts.tv_sec = (time_t)sleeptime;
|
|
ts.tv_nsec = (long)((sleeptime - (double)ts.tv_sec) * 1E9);
|
|
nanosleep(&ts, NULL);
|
|
}
|
|
|
|
#endif // _WIN32
|
|
|
|
#endif // MY_SLEEP_H
|