@@ -183,11 +183,9 @@ TEST(DWARFDie, getDeclFile) {
183
183
std::string DeclFile = MainDie.getDeclFile (
184
184
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
185
185
186
- #if defined(_WIN32)
187
- EXPECT_EQ (DeclFile, " /tmp\\ main.cpp" );
188
- #else
189
- EXPECT_EQ (DeclFile, " /tmp/main.cpp" );
190
- #endif
186
+ std::string Ref =
187
+ (" /tmp" + llvm::sys::path::get_separator () + " main.cpp" ).str ();
188
+ EXPECT_EQ (DeclFile, Ref);
191
189
}
192
190
193
191
TEST (DWARFDie, getDeclFileAbstractOrigin) {
@@ -291,11 +289,9 @@ TEST(DWARFDie, getDeclFileAbstractOrigin) {
291
289
std::string DeclFile = MainDie.getDeclFile (
292
290
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
293
291
294
- #if defined(_WIN32)
295
- EXPECT_EQ (DeclFile, " /tmp\\ main.cpp" );
296
- #else
297
- EXPECT_EQ (DeclFile, " /tmp/main.cpp" );
298
- #endif
292
+ std::string Ref =
293
+ (" /tmp" + llvm::sys::path::get_separator () + " main.cpp" ).str ();
294
+ EXPECT_EQ (DeclFile, Ref);
299
295
}
300
296
301
297
TEST (DWARFDie, getDeclFileSpecification) {
@@ -398,11 +394,9 @@ TEST(DWARFDie, getDeclFileSpecification) {
398
394
std::string DeclFile = MainDie.getDeclFile (
399
395
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
400
396
401
- #if defined(_WIN32)
402
- EXPECT_EQ (DeclFile, " /tmp\\ main.cpp" );
403
- #else
404
- EXPECT_EQ (DeclFile, " /tmp/main.cpp" );
405
- #endif
397
+ std::string Ref =
398
+ (" /tmp" + llvm::sys::path::get_separator () + " main.cpp" ).str ();
399
+ EXPECT_EQ (DeclFile, Ref);
406
400
}
407
401
408
402
TEST (DWARFDie, getDeclFileAbstractOriginAcrossCUBoundary) {
@@ -522,11 +516,9 @@ TEST(DWARFDie, getDeclFileAbstractOriginAcrossCUBoundary) {
522
516
std::string DeclFile = MainDie.getDeclFile (
523
517
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
524
518
525
- #if defined(_WIN32)
526
- EXPECT_EQ (DeclFile, " /tmp\\ main.cpp" );
527
- #else
528
- EXPECT_EQ (DeclFile, " /tmp/main.cpp" );
529
- #endif
519
+ std::string Ref =
520
+ (" /tmp" + llvm::sys::path::get_separator () + " main.cpp" ).str ();
521
+ EXPECT_EQ (DeclFile, Ref);
530
522
}
531
523
532
524
TEST (DWARFDie, getDeclFileSpecificationAcrossCUBoundary) {
@@ -646,11 +638,9 @@ TEST(DWARFDie, getDeclFileSpecificationAcrossCUBoundary) {
646
638
std::string DeclFile = MainDie.getDeclFile (
647
639
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath);
648
640
649
- #if defined(_WIN32)
650
- EXPECT_EQ (DeclFile, " /tmp\\ main.cpp" );
651
- #else
652
- EXPECT_EQ (DeclFile, " /tmp/main.cpp" );
653
- #endif
641
+ std::string Ref =
642
+ (" /tmp" + llvm::sys::path::get_separator () + " main.cpp" ).str ();
643
+ EXPECT_EQ (DeclFile, Ref);
654
644
}
655
645
656
646
} // end anonymous namespace
0 commit comments