std::string DeclFile = MainDie.getDeclFile(
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
-#if defined(_WIN32)
- EXPECT_EQ(DeclFile, "/tmp\\main.cpp");
-#else
- EXPECT_EQ(DeclFile, "/tmp/main.cpp");
-#endif
+ std::string Ref =
+ ("/tmp" + llvm::sys::path::get_separator() + "main.cpp").str();
+ EXPECT_EQ(DeclFile, Ref);
}
TEST(DWARFDie, getDeclFileAbstractOrigin) {
std::string DeclFile = MainDie.getDeclFile(
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
-#if defined(_WIN32)
- EXPECT_EQ(DeclFile, "/tmp\\main.cpp");
-#else
- EXPECT_EQ(DeclFile, "/tmp/main.cpp");
-#endif
+ std::string Ref =
+ ("/tmp" + llvm::sys::path::get_separator() + "main.cpp").str();
+ EXPECT_EQ(DeclFile, Ref);
}
TEST(DWARFDie, getDeclFileSpecification) {
std::string DeclFile = MainDie.getDeclFile(
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
-#if defined(_WIN32)
- EXPECT_EQ(DeclFile, "/tmp\\main.cpp");
-#else
- EXPECT_EQ(DeclFile, "/tmp/main.cpp");
-#endif
+ std::string Ref =
+ ("/tmp" + llvm::sys::path::get_separator() + "main.cpp").str();
+ EXPECT_EQ(DeclFile, Ref);
}
TEST(DWARFDie, getDeclFileAbstractOriginAcrossCUBoundary) {
std::string DeclFile = MainDie.getDeclFile(
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
-#if defined(_WIN32)
- EXPECT_EQ(DeclFile, "/tmp\\main.cpp");
-#else
- EXPECT_EQ(DeclFile, "/tmp/main.cpp");
-#endif
+ std::string Ref =
+ ("/tmp" + llvm::sys::path::get_separator() + "main.cpp").str();
+ EXPECT_EQ(DeclFile, Ref);
}
TEST(DWARFDie, getDeclFileSpecificationAcrossCUBoundary) {
std::string DeclFile = MainDie.getDeclFile(
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
-#if defined(_WIN32)
- EXPECT_EQ(DeclFile, "/tmp\\main.cpp");
-#else
- EXPECT_EQ(DeclFile, "/tmp/main.cpp");
-#endif
+ std::string Ref =
+ ("/tmp" + llvm::sys::path::get_separator() + "main.cpp").str();
+ EXPECT_EQ(DeclFile, Ref);
}
} // end anonymous namespace