From 2934b3ffb8d3e198db9a4a0cce149c856103040c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 28 Nov 2023 21:36:18 +0200 Subject: [PATCH] Update source_location_test3.cpp --- test/source_location_test3.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/source_location_test3.cpp b/test/source_location_test3.cpp index 6d01a4b..810c3ee 100644 --- a/test/source_location_test3.cpp +++ b/test/source_location_test3.cpp @@ -5,6 +5,21 @@ #include #include #include +#include + +static char const* adjust_filename( char const* file ) +{ +#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20210300 + + char const* fn = std::strrchr( file, '/' ); + return fn? fn + 1: file; + +#else + + return file; + +#endif +} int main() { @@ -61,7 +76,7 @@ int main() { boost::source_location loc = BOOST_CURRENT_LOCATION; - std::string prefix = std::string( __FILE__ ) + ":62"; + std::string prefix = std::string( adjust_filename(__FILE__) ) + ":77"; BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix ); std::ostringstream os;