Skip to content

Commit

Permalink
Automatically adjust C++ version of PCH in Cling's test
Browse files Browse the repository at this point in the history
This fixes test/CodeUnloading/PCH/VTables.C with C++17 and later.
  • Loading branch information
hahnjo authored and jenkins committed Jul 20, 2023
1 parent a9ebc38 commit c157468
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/CodeUnloading/PCH/VTables.C
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %mkdir "%T/Rel/Path" || true
// RUN: %rm "CompGen.h.pch" && %rm "%T/Rel/Path/Relative.pch"
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread %S/Inputs/CompGen.h -o CompGen.h.pch
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread %S/Inputs/CompGen.h -o %T/Rel/Path/Relative.pch
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=%std_cxx -pthread %S/Inputs/CompGen.h -o CompGen.h.pch
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=%std_cxx -pthread %S/Inputs/CompGen.h -o %T/Rel/Path/Relative.pch
// RUN: cat %s | %cling -I%p -Xclang -include-pch -Xclang CompGen.h.pch 2>&1 | FileCheck %s
// RUN: cat %s | %cling -I%p -I%T/Rel/Path -include-pch Relative.pch 2>&1 | FileCheck %s

Expand Down
2 changes: 2 additions & 0 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ config.substitutions.append(('%cling_obj_root', config.cling_obj_root))
incDir = os.path.join(config.llvm_obj_root, 'tools', 'clang', 'include')
config.substitutions.append( ('%cling', config.llvm_tools_dir + '/cling --nologo -I%s' % fixupPath(incDir)) )

config.substitutions.append(('%std_cxx', 'c++' + config.cxx_standard))

if platform.system() in ['Windows']:
config.substitutions.append(('%dllexport', '"__declspec(dllexport)"'))
config.substitutions.append(('%fPIC', ''))
Expand Down
1 change: 1 addition & 0 deletions test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config.cling_obj_root = "@CLING_BINARY_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.host_triple = "@TARGET_TRIPLE@"
config.shlibext = "@TARGET_SHLIBEXT@"
config.cxx_standard = "@CMAKE_CXX_STANDARD@"

# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
Expand Down

0 comments on commit c157468

Please sign in to comment.