summaryrefslogtreecommitdiffstats
path: root/Tests/Cuda/ObjectLibrary/main.cpp
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-31 13:36:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-31 13:36:24 (GMT)
commit4499cc8bb65e217e1cb2959452ed391af82e757b (patch)
tree1eada76ab92c4f4dad203e736248c0d9fce44af8 /Tests/Cuda/ObjectLibrary/main.cpp
parenta7ee918f197300ffed8f4ae0fafe6c3c2f4ea1b6 (diff)
parentfa583869f7e75cdc4c7499f0dbfab2cdac5061bd (diff)
downloadCMake-4499cc8bb65e217e1cb2959452ed391af82e757b.zip
CMake-4499cc8bb65e217e1cb2959452ed391af82e757b.tar.gz
CMake-4499cc8bb65e217e1cb2959452ed391af82e757b.tar.bz2
Merge topic 'msvc_cuda_files_use_consistent_obj_names'
fa583869 CUDA: Use MSVC default pattern for naming object files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1722
Diffstat (limited to 'Tests/Cuda/ObjectLibrary/main.cpp')
-rw-r--r--Tests/Cuda/ObjectLibrary/main.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/Tests/Cuda/ObjectLibrary/main.cpp b/Tests/Cuda/ObjectLibrary/main.cpp
index 4d2f890..e28f088 100644
--- a/Tests/Cuda/ObjectLibrary/main.cpp
+++ b/Tests/Cuda/ObjectLibrary/main.cpp
@@ -1,22 +1,18 @@
#include <iostream>
-int static_func(int);
-int file1_sq_func(int);
+int cpp_sq_func(int);
+int cu1_sq_func(int);
+int cu2_sq_func(int);
-int test_functions()
+bool test_functions()
{
- return file1_sq_func(static_func(42));
+ return (cu1_sq_func(42) == cpp_sq_func(42)) &&
+ (cu2_sq_func(42) == cpp_sq_func(42));
}
int main(int argc, char** argv)
{
- if (test_functions() == 1) {
- return 1;
- }
- std::cout
- << "this executable doesn't use cuda code, just call methods defined"
- << std::endl;
- std::cout << "in object files that have cuda code" << std::endl;
- return 0;
+ int result = test_functions() ? 0 : 1;
+ return result;
}