Skip to content

Commit e3047a0

Browse files
committed
Automatically adjust C++ version of PCH in Cling's test
This fixes test/CodeUnloading/PCH/VTables.C with C++17 and later.
1 parent debbd9b commit e3047a0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

interpreter/cling/test/CodeUnloading/PCH/VTables.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %mkdir "%T/Rel/Path" || true
22
// RUN: %rm "CompGen.h.pch" && %rm "%T/Rel/Path/Relative.pch"
3-
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread %S/Inputs/CompGen.h -o CompGen.h.pch
4-
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=c++14 -pthread %S/Inputs/CompGen.h -o %T/Rel/Path/Relative.pch
3+
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=%std_cxx -pthread %S/Inputs/CompGen.h -o CompGen.h.pch
4+
// RUN: clang -x c++-header -fexceptions -fcxx-exceptions -std=%std_cxx -pthread %S/Inputs/CompGen.h -o %T/Rel/Path/Relative.pch
55
// RUN: cat %s | %cling -I%p -Xclang -include-pch -Xclang CompGen.h.pch 2>&1 | FileCheck %s
66
// RUN: cat %s | %cling -I%p -I%T/Rel/Path -include-pch Relative.pch 2>&1 | FileCheck %s
77

interpreter/cling/test/lit.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ config.substitutions.append(('%cling_obj_root', config.cling_obj_root))
7676
incDir = os.path.join(config.llvm_obj_root, 'tools', 'clang', 'include')
7777
config.substitutions.append( ('%cling', config.llvm_tools_dir + '/cling --nologo -I%s' % fixupPath(incDir)) )
7878

79+
config.substitutions.append(('%std_cxx', 'c++' + config.cxx_standard))
80+
7981
if platform.system() in ['Windows']:
8082
config.substitutions.append(('%dllexport', '"__declspec(dllexport)"'))
8183
config.substitutions.append(('%fPIC', ''))

interpreter/cling/test/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ config.cling_obj_root = "@CLING_BINARY_DIR@"
88
config.target_triple = "@TARGET_TRIPLE@"
99
config.host_triple = "@TARGET_TRIPLE@"
1010
config.shlibext = "@TARGET_SHLIBEXT@"
11+
config.cxx_standard = "@CMAKE_CXX_STANDARD@"
1112

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

0 commit comments

Comments
 (0)