[PGO] Fix expensive test compilation error
authorChristian Ulmann <christian.ulmann@nextsilicon.com>
Fri, 28 Apr 2023 12:10:47 +0000 (12:10 +0000)
committerChristian Ulmann <christian.ulmann@nextsilicon.com>
Fri, 28 Apr 2023 12:17:01 +0000 (12:17 +0000)
This commit fixes a compilation error introduced in
https://reviews.llvm.org/D149361

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D149434

llvm/unittests/ProfileData/InstrProfTest.cpp

index d7b9d73..30c4dac 100644 (file)
@@ -1356,16 +1356,18 @@ TEST(ProfileReaderTest, ReadsLargeFiles) {
   if (!RawProfile)
     GTEST_SKIP();
   auto RawProfileReaderOrErr = InstrProfReader::create(std::move(RawProfile));
-  ASSERT_TRUE(InstrProfError::take(RawProfileReaderOrErr.takeError()) ==
-              instrprof_error::unrecognized_format);
+  ASSERT_TRUE(
+      std::get<0>(InstrProfError::take(RawProfileReaderOrErr.takeError())) ==
+      instrprof_error::unrecognized_format);
 
   auto IndexedProfile = WritableMemoryBuffer::getNewUninitMemBuffer(LargeSize);
   if (!IndexedProfile)
     GTEST_SKIP();
   auto IndexedReaderOrErr =
       IndexedInstrProfReader::create(std::move(IndexedProfile), nullptr);
-  ASSERT_TRUE(InstrProfError::take(IndexedReaderOrErr.takeError()) ==
-              instrprof_error::bad_magic);
+  ASSERT_TRUE(
+      std::get<0>(InstrProfError::take(IndexedReaderOrErr.takeError())) ==
+      instrprof_error::bad_magic);
 }
 #endif