summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/ParseImplicitIncludeInfo
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-08-23 16:49:27 -0400
committerRobert Maynard <robert.maynard@kitware.com>2019-08-28 10:39:53 -0400
commitb5f20da94dacf1502a2de1b33cbed69163b3e143 (patch)
treea884de8024c52d88a1461f1de99ca9ceb21bead9 /Tests/RunCMake/ParseImplicitIncludeInfo
parent2200bc068b8f6a127d92720c336142bd57ce994b (diff)
downloadcmake-b5f20da94dacf1502a2de1b33cbed69163b3e143.tar.gz
CMakeParseImplicitLinkInfo supports comma separated link lines
It is currently presumed that the linker will generate a space separated line. This is not the case for some compilers such as IBM XL where it can output space or comma separated. This is particularly apparent when IBM XL is used as the host compiler for CUDA as it generates a comma separated link line.
Diffstat (limited to 'Tests/RunCMake/ParseImplicitIncludeInfo')
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake14
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output0
3 files changed, 10 insertions, 5 deletions
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
index eb531befa3..abd0eaa021 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
@@ -32,7 +32,8 @@ set(targets
linux_nostdinc-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
linux_nostdinc_i-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
linux-C-XL-16.1.0.0 linux-CXX-XL-16.1.0.0
- linux-CUDA-NVIDIA-9.2.148-GCC
+ linux-CUDA-NVIDIA-10.1.168-CLANG linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty
+ linux-CUDA-NVIDIA-9.2.148-GCC
mingw.org-C-GNU-4.9.3 mingw.org-CXX-GNU-4.9.3
netbsd-C-GNU-4.8.5 netbsd-CXX-GNU-4.8.5
netbsd_nostdinc-C-GNU-4.8.5 netbsd_nostdinc-CXX-GNU-4.8.5
@@ -100,8 +101,11 @@ foreach(t ${targets})
set(infile "${CMAKE_SOURCE_DIR}/../ParseImplicitData/${t}.input")
set(outfile "${CMAKE_SOURCE_DIR}/results/${t}.output")
if (NOT EXISTS ${infile})
- message("missing input file for target ${t} in ${CMAKE_SOURCE_DIR}/../ParseImplicitData/")
- continue()
+ string(REPLACE "-empty" "" infile "${infile}")
+ if (NOT EXISTS ${infile})
+ message("missing input file for target ${t} in ${CMAKE_SOURCE_DIR}/../ParseImplicitData/")
+ continue()
+ endif()
elseif(NOT EXISTS ${outfile})
message("missing files for target ${t} in ${CMAKE_SOURCE_DIR}/results/")
continue()
@@ -111,13 +115,13 @@ foreach(t ${targets})
file(READ ${outfile} output)
string(STRIP "${output}" output)
cmake_parse_implicit_include_info("${input}" "${lang}" idirs log state)
+
if(t MATCHES "-empty$") # empty isn't supposed to parse
if("${state}" STREQUAL "done")
message("empty parse failed: ${idirs}, log=${log}")
endif()
elseif(NOT "${state}" STREQUAL "done" OR NOT "${idirs}" MATCHES "^${output}$")
- message(${t})
- message("parse failed: state=${state}, '${idirs}' does not match '^${output}$', log=${log}")
+ message("${t} parse failed: state=${state}, '${idirs}' does not match '^${output}$', log=${log}")
endif()
unload_compiler_info("${cmvars}")
endforeach(t)
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
new file mode 100644
index 0000000000..84149e6c35
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
@@ -0,0 +1 @@
+/usr/local/cuda/targets/x86_64-linux/include;/usr/include/c\+\+/8;/usr/include/x86_64-linux-gnu/c\+\+/8;/usr/include/c\+\+/8/backward;/usr/include/clang/8.0.1/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output