Index: test-suite/trunk/External/CUDA/CMakeLists.txt =================================================================== --- test-suite/trunk/External/CUDA/CMakeLists.txt +++ test-suite/trunk/External/CUDA/CMakeLists.txt @@ -46,6 +46,7 @@ macro(create_local_cuda_tests VariantSuffix) create_one_local_test(axpy axpy.cu) create_one_local_test(empty empty.cu) + create_one_local_test(future future.cu) endmacro() macro(thrust_make_test_name TestName TestSourcePath) Index: test-suite/trunk/External/CUDA/future.cu =================================================================== --- test-suite/trunk/External/CUDA/future.cu +++ test-suite/trunk/External/CUDA/future.cu @@ -0,0 +1,21 @@ +// Make sure that we can compile CUDA files that include and use +// std::shared_future. +// +// At one point in time this didn't work because clang defined different values +// for __GCC_ATOMIC_INT_LOCK_FREE on host and device. This caused libstdc++ +// not to define std::shared_future when compiling for device, resulting in +// compile errors (even though we only use std::shared_future in host code). + +#if __cplusplus >= 201103L +#include + +void foo() { + std::shared_future x; +} +#else +#warning Skipping test because not compiled in C++11 mode. +#endif + +int main() { + return 0; +}