Remove VISIBILITY_HIDDEN from this file.
[llvm/avr.git] / cmake / modules / CheckAtomic.cmake
blob27bbaba6998c99416a56a151ffd8cbf697216d17
1 # atomic builtins are required for threading support.
3 INCLUDE(CheckCXXSourceCompiles)
4         
5 CHECK_CXX_SOURCE_COMPILES("
6 int main() {
7         volatile unsigned long val = 1;
8         __sync_synchronize();
9         __sync_val_compare_and_swap(&val, 1, 0);
10         __sync_add_and_fetch(&val, 1);
11         __sync_sub_and_fetch(&val, 1);
12         return 0;
13       }
14 " LLVM_MULTITHREADED)
16 if( NOT LLVM_MULTITHREADED )
17   message(STATUS "Warning: LLVM will be built thread-unsafe because atomic builtins are missing")
18 endif()