[Openmp-commits] [PATCH] D38878: Add C++ support for testcases

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 20 12:43:23 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL316230: Add C++ support for testcases (authored by jlpeyton).

Changed prior to commit:
  https://reviews.llvm.org/D38878?vs=118893&id=119690#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38878

Files:
  openmp/trunk/runtime/test/CMakeLists.txt
  openmp/trunk/runtime/test/lit.cfg
  openmp/trunk/runtime/test/lit.site.cfg.in
  openmp/trunk/runtime/test/tasking/kmp_task_reduction_nest.cpp


Index: openmp/trunk/runtime/test/CMakeLists.txt
===================================================================
--- openmp/trunk/runtime/test/CMakeLists.txt
+++ openmp/trunk/runtime/test/CMakeLists.txt
@@ -51,6 +51,8 @@
   endif()
   set(LIBOMP_TEST_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
     "Compiler to use for testing OpenMP library")
+  set(LIBOMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING
+    "Compiler to use for testing OpenMP library")
   set(LIBOMP_TEST_OPENMP_FLAG -fopenmp CACHE STRING
     "OpenMP compiler flag to use for testing OpenMP library")
   find_program(LIBOMP_LLVM_LIT_EXECUTABLE
@@ -90,8 +92,10 @@
   # LLVM source tree build, test just-built clang
   if(NOT MSVC)
     set(LIBOMP_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+    set(LIBOMP_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
   else()
     set(LIBOMP_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe)
+    set(LIBOMP_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe)
   endif()
   set(LIBOMP_TEST_OPENMP_FLAG -fopenmp=libomp)
   set(FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
Index: openmp/trunk/runtime/test/tasking/kmp_task_reduction_nest.cpp
===================================================================
--- openmp/trunk/runtime/test/tasking/kmp_task_reduction_nest.cpp
+++ openmp/trunk/runtime/test/tasking/kmp_task_reduction_nest.cpp
@@ -1,5 +1,5 @@
-// RUN: %libomp-compile-and-run
-// RUN: %libomp-compile -DFLG=1 && %libomp-run
+// RUN: %libomp-cxx-compile-and-run
+// RUN: %libomp-cxx-compile -DFLG=1 && %libomp-run
 #include <cstdio>
 #include <cmath>
 #include <cassert>
Index: openmp/trunk/runtime/test/lit.site.cfg.in
===================================================================
--- openmp/trunk/runtime/test/lit.site.cfg.in
+++ openmp/trunk/runtime/test/lit.site.cfg.in
@@ -1,6 +1,7 @@
 @AUTO_GEN_COMMENT@
 
 config.test_compiler = "@LIBOMP_TEST_COMPILER@"
+config.test_cxx_compiler = "@LIBOMP_TEST_CXX_COMPILER@"
 config.test_filecheck = "@FILECHECK_EXECUTABLE@"
 config.test_openmp_flag = "@LIBOMP_TEST_OPENMP_FLAG@"
 config.test_extra_cflags = "@LIBOMP_TEST_CFLAGS@"
Index: openmp/trunk/runtime/test/lit.cfg
===================================================================
--- openmp/trunk/runtime/test/lit.cfg
+++ openmp/trunk/runtime/test/lit.cfg
@@ -30,7 +30,7 @@
 config.name = 'libomp'
 
 # suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c']
+config.suffixes = ['.c', '.cpp']
 
 # test_source_root: The root path where tests are located.
 config.test_source_root = os.path.dirname(__file__)
@@ -99,9 +99,14 @@
 
 config.substitutions.append(("%libomp-compile-and-run", \
     "%libomp-compile && %libomp-run"))
+config.substitutions.append(("%libomp-cxx-compile-and-run", \
+    "%libomp-cxx-compile && %libomp-run"))
+config.substitutions.append(("%libomp-cxx-compile", \
+    "%clangXX %cflags -std=c++11 %s -o %t" + libs))
 config.substitutions.append(("%libomp-compile", \
     "%clang %cflags %s -o %t" + libs))
 config.substitutions.append(("%libomp-run", "%t"))
+config.substitutions.append(("%clangXX", config.test_cxx_compiler))
 config.substitutions.append(("%clang", config.test_compiler))
 config.substitutions.append(("%openmp_flag", config.test_openmp_flag))
 config.substitutions.append(("%cflags", config.test_cflags))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38878.119690.patch
Type: text/x-patch
Size: 3368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20171020/6a97984f/attachment.bin>


More information about the Openmp-commits mailing list