[llvm] 7fc8715 - [unittests] Use GTEST_SKIP() instead of return when appropriate

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 13:59:09 PST 2023


Author: Paul Robinson
Date: 2023-01-25T13:59:01-08:00
New Revision: 7fc871591f1399cd88ff301ed84fa67dc3bf7a6b

URL: https://github.com/llvm/llvm-project/commit/7fc871591f1399cd88ff301ed84fa67dc3bf7a6b
DIFF: https://github.com/llvm/llvm-project/commit/7fc871591f1399cd88ff301ed84fa67dc3bf7a6b.diff

LOG: [unittests] Use GTEST_SKIP() instead of return when appropriate

Basically NFC: A TEST/TEST_F/etc that bails out early (usually because
setup failed or some other runtime condition wasn't met) generally
should use GTEST_SKIP() to report its status correctly, unless it
takes steps to report another status (e.g., FAIL()).

I did see a handful of tests show up as SKIPPED after this change,
which is not unexpected. The status seemed appropriate in all the new
cases.

Added: 
    

Modified: 
    llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp
    llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
    llvm/unittests/CodeGen/GlobalISel/ConstantFoldingTest.cpp
    llvm/unittests/CodeGen/GlobalISel/GISelAliasTest.cpp
    llvm/unittests/CodeGen/GlobalISel/GISelUtilsTest.cpp
    llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
    llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp
    llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
    llvm/unittests/CodeGen/GlobalISel/LegalizerTest.cpp
    llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp
    llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
    llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp
    llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
    llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
    llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp
    llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
    llvm/unittests/MC/Disassembler.cpp
    llvm/unittests/MC/DwarfLineTableHeaders.cpp
    llvm/unittests/MC/DwarfLineTables.cpp
    llvm/unittests/MC/MCInstPrinter.cpp
    llvm/unittests/Object/ArchiveTest.cpp
    llvm/unittests/Object/ELFObjectFileTest.cpp
    llvm/unittests/Passes/PluginsTest.cpp
    llvm/unittests/ProfileData/InstrProfTest.cpp
    llvm/unittests/Support/CRCTest.cpp
    llvm/unittests/Support/MemoryTest.cpp
    llvm/unittests/Support/Path.cpp
    llvm/unittests/Support/ThreadPool.cpp
    llvm/unittests/Target/AMDGPU/ExecMayBeModifiedBeforeAnyUse.cpp
    llvm/unittests/Target/ARM/InstSizes.cpp
    llvm/unittests/Target/ARM/MachineInstrTest.cpp
    llvm/unittests/tools/llvm-cfi-verify/FileAnalysis.cpp
    llvm/unittests/tools/llvm-cfi-verify/GraphBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp b/llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp
index 7f295f90e9613..55ffa0ea622f3 100644
--- a/llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp
+++ b/llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp
@@ -260,8 +260,8 @@ define i32 @fib_check(){
 // the plugin being loaded acts identically to the default inliner
 TEST(PluginInlineAdvisorTest, PluginLoad) {
 #if !defined(LLVM_ENABLE_PLUGINS)
-  // Disable the test if plugins are disabled.
-  return;
+  // Skip the test if plugins are disabled.
+  GTEST_SKIP();
 #endif
   CompilerInstance CI{};
   CI.setupPlugin();

diff  --git a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
index d296864f30ad6..116099eff14aa 100644
--- a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
@@ -16,7 +16,7 @@ namespace {
 TEST_F(AArch64GISelMITest, TestCSE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s16{LLT::scalar(16)};
   LLT s32{LLT::scalar(32)};
@@ -139,7 +139,7 @@ TEST_F(AArch64GISelMITest, TestCSE) {
 TEST_F(AArch64GISelMITest, TestCSEConstantConfig) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s16{LLT::scalar(16)};
   auto MIBInput = B.buildInstr(TargetOpcode::G_TRUNC, {s16}, {Copies[0]});
@@ -169,7 +169,7 @@ TEST_F(AArch64GISelMITest, TestCSEConstantConfig) {
 TEST_F(AArch64GISelMITest, TestCSEImmediateNextCSE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s32{LLT::scalar(32)};
   // We want to check that when the CSE hit is on the next instruction, i.e. at
@@ -194,7 +194,7 @@ TEST_F(AArch64GISelMITest, TestCSEImmediateNextCSE) {
 TEST_F(AArch64GISelMITest, TestConstantFoldCTL) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s32 = LLT::scalar(32);
 

diff  --git a/llvm/unittests/CodeGen/GlobalISel/ConstantFoldingTest.cpp b/llvm/unittests/CodeGen/GlobalISel/ConstantFoldingTest.cpp
index aff9181725dd2..f37c5e1c7e224 100644
--- a/llvm/unittests/CodeGen/GlobalISel/ConstantFoldingTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/ConstantFoldingTest.cpp
@@ -20,7 +20,7 @@ namespace {
 TEST_F(AArch64GISelMITest, FoldWithBuilder) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   // Try to use the FoldableInstructionsBuilder to build binary ops.
   CSEMIRBuilder CFB(B.getState());
   LLT s32 = LLT::scalar(32);
@@ -71,7 +71,7 @@ TEST_F(AArch64GISelMITest, FoldWithBuilder) {
 TEST_F(AArch64GISelMITest, FoldBinOp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s32{LLT::scalar(32)};
   auto MIBCst1 = B.buildConstant(s32, 16);

diff  --git a/llvm/unittests/CodeGen/GlobalISel/GISelAliasTest.cpp b/llvm/unittests/CodeGen/GlobalISel/GISelAliasTest.cpp
index cd98a05dcc2ba..992866f48a9ae 100644
--- a/llvm/unittests/CodeGen/GlobalISel/GISelAliasTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/GISelAliasTest.cpp
@@ -21,7 +21,7 @@ namespace {
 TEST_F(AArch64GISelMITest, SimpleAlias) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S64 = LLT::scalar(64);
   LLT P0 = LLT::pointer(0, 64);
@@ -73,7 +73,7 @@ TEST_F(AArch64GISelMITest, SimpleAlias) {
 TEST_F(AArch64GISelMITest, OffsetAliasing) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S64 = LLT::scalar(64);
   LLT P0 = LLT::pointer(0, 64);
@@ -103,7 +103,7 @@ TEST_F(AArch64GISelMITest, OffsetAliasing) {
 TEST_F(AArch64GISelMITest, FrameIndexAliasing) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S64 = LLT::scalar(64);
   LLT P0 = LLT::pointer(0, 64);

diff  --git a/llvm/unittests/CodeGen/GlobalISel/GISelUtilsTest.cpp b/llvm/unittests/CodeGen/GlobalISel/GISelUtilsTest.cpp
index 939195c1bc27d..8fda332d5c054 100644
--- a/llvm/unittests/CodeGen/GlobalISel/GISelUtilsTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/GISelUtilsTest.cpp
@@ -249,7 +249,7 @@ TEST(GISelUtilsTest, getLCMType) {
 TEST_F(AArch64GISelMITest, ConstFalseTest) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   const auto &TLI = *B.getMF().getSubtarget().getTargetLowering();
   bool BooleanChoices[2] = {true, false};
 

diff  --git a/llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp b/llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
index c85d62a828cc1..79f2f0643d11d 100644
--- a/llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
@@ -15,7 +15,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsCst) {
                         "  %4:_(s8) = COPY %3\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   unsigned CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   unsigned SrcReg = FinalCopy->getOperand(1).getReg();
@@ -35,7 +35,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsCstWithClass) {
                         "  %4:_(s32) = COPY %10\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   unsigned CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   unsigned SrcReg = FinalCopy->getOperand(1).getReg();
@@ -74,7 +74,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsCstPHI) {
                         "  %14:_(s8) = COPY %13\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   Register SrcReg = FinalCopy->getOperand(1).getReg();
@@ -108,7 +108,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsCstPHIToNonGenericReg) {
                         "  %14:_(s8) = COPY %13\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   Register SrcReg = FinalCopy->getOperand(1).getReg();
@@ -146,7 +146,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsUnknownPHI) {
       "  %14:_(s64) = COPY %13\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   Register SrcReg = FinalCopy->getOperand(1).getReg();
@@ -183,7 +183,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsCstPHIWithLoop) {
       "  G_BR %bb.12\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   Register SrcReg = FinalCopy->getOperand(1).getReg();
@@ -222,7 +222,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsDecreasingCstPHIWithLoop) {
                         "  G_BR %bb.12\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   Register SrcReg = FinalCopy->getOperand(1).getReg();
@@ -250,7 +250,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsPtrToIntViceVersa) {
                         "  %6:_(s32) = COPY %5\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   unsigned CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   unsigned SrcReg = FinalCopy->getOperand(1).getReg();
@@ -278,7 +278,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsAND) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -310,7 +310,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsOR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -342,7 +342,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsXOR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -365,7 +365,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsXORConstant) {
                         "  %6:_(s8) = COPY %5\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   unsigned CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   unsigned SrcReg = FinalCopy->getOperand(1).getReg();
@@ -397,7 +397,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsASHR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 2];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -441,7 +441,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsLSHR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 2];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -478,7 +478,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsSHL) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -509,7 +509,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsADD) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -542,7 +542,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsSUB) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -569,7 +569,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsMUL) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -597,7 +597,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsICMP) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -620,7 +620,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsFCMP) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -652,7 +652,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsSelect) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -685,7 +685,7 @@ TEST_F(AArch64GISelMITest, TestKnownBits) {
                   "  %13:_(s32) = COPY %12\n";
   setUp(MIR);
   if (!TM)
-    return;
+    GTEST_SKIP();
   unsigned CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   unsigned SrcReg = FinalCopy->getOperand(1).getReg();
@@ -701,7 +701,7 @@ TEST_F(AArch64GISelMITest, TestKnownBits) {
 TEST_F(AArch64GISelMITest, TestSignBitIsZero) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const LLT S32 = LLT::scalar(32);
   auto SignBit = B.buildConstant(S32, 0x80000000);
@@ -730,7 +730,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsConstant) {
                         "  %12:_(s8) = COPY %11\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyReg1 = Copies[Copies.size() - 5];
   Register CopyRegNeg1 = Copies[Copies.size() - 4];
   Register CopyReg127 = Copies[Copies.size() - 3];
@@ -756,7 +756,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsSext) {
                         "  %9:_(s32) = COPY %8\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopySextLoad = Copies[Copies.size() - 2];
   Register CopySextNeg1 = Copies[Copies.size() - 1];
 
@@ -803,7 +803,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsSextInReg) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyInReg7 = Copies[Copies.size() - 9];
   Register CopyInReg8 = Copies[Copies.size() - 8];
@@ -870,7 +870,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsAssertSext) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyInReg1 = Copies[Copies.size() - 10];
   Register CopyInReg7 = Copies[Copies.size() - 9];
@@ -913,7 +913,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsTrunc) {
                         "  %12:_(s8) = COPY %11\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyTruncLoad = Copies[Copies.size() - 3];
   Register CopyTruncNeg1 = Copies[Copies.size() - 2];
   Register CopyTrunc7 = Copies[Copies.size() - 1];
@@ -941,7 +941,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsCmp) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyVecFCMP = Copies[Copies.size() - 4];
   Register CopyVecICMP = Copies[Copies.size() - 3];
   Register CopyScalarFCMP = Copies[Copies.size() - 2];
@@ -972,7 +972,7 @@ TEST_F(AMDGPUGISelMITest, TestNumSignBitsTrunc) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyLoadUByte = Copies[Copies.size() - 4];
   Register CopyLoadSByte = Copies[Copies.size() - 3];
@@ -1002,7 +1002,7 @@ TEST_F(AMDGPUGISelMITest, TestTargetKnownAlign) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyDispatchPtr = Copies[Copies.size() - 5];
   Register CopyQueuePtr = Copies[Copies.size() - 4];
@@ -1064,7 +1064,7 @@ TEST_F(AMDGPUGISelMITest, TestIsKnownToBeAPowerOfTwo) {
 )MIR";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   GISelKnownBits KB(*MF);
 
@@ -1109,7 +1109,7 @@ TEST_F(AArch64GISelMITest, TestMetadata) {
                         "  %copy:_(s32) = COPY %and(s32)\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -1160,7 +1160,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsExt) {
                         "  %r3:_(s32) = COPY %sext\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyRegAny = Copies[Copies.size() - 3];
   Register CopyRegZ = Copies[Copies.size() - 2];
   Register CopyRegS = Copies[Copies.size() - 1];
@@ -1230,7 +1230,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsSextInReg) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   GISelKnownBits Info(*MF);
   KnownBits Res;
   auto GetKB = [&](unsigned Idx) {
@@ -1301,7 +1301,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsAssertSext) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   GISelKnownBits Info(*MF);
   KnownBits Res;
   auto GetKB = [&](unsigned Idx) {
@@ -1346,7 +1346,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsMergeValues) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const uint64_t TestVal = UINT64_C(0xabcd123344568998);
   Register CopyMerge = Copies[Copies.size() - 1];
@@ -1370,7 +1370,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsUnmergeValues) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const uint64_t TestVal = UINT64_C(0xabcd123344568998);
   GISelKnownBits Info(*MF);
@@ -1397,7 +1397,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsBSwapBitReverse) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const uint32_t ByteSwappedVal = 0x44332211;
   const uint32_t BitSwappedVal = 0x22cc4488;
@@ -1447,7 +1447,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsUMAX) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 2];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1485,7 +1485,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsUMax) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyUMax = Copies[Copies.size() - 1];
   GISelKnownBits Info(*MF);
@@ -1517,7 +1517,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsUMIN) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1551,7 +1551,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsSMAX) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1586,7 +1586,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsSMIN) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1615,7 +1615,7 @@ TEST_F(AArch64GISelMITest, TestInvalidQueries) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register EqSizedCopyReg = Copies[Copies.size() - 2];
   MachineInstr *EqSizedCopy = MRI->getVRegDef(EqSizedCopyReg);
@@ -1657,7 +1657,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsAssertZext) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyAssert8 = Copies[Copies.size() - 4];
   Register CopyAssert1 = Copies[Copies.size() - 3];
@@ -1719,7 +1719,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsCTPOP) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register UnknownCopy = Copies[Copies.size() - 4];
   Register ThirtytwoCopy = Copies[Copies.size() - 3];
@@ -1779,7 +1779,7 @@ TEST_F(AMDGPUGISelMITest, TestKnownBitsUBFX) {
                         "  %ubfx_copy_unk_width:_(s32) = COPY %13\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyBfxReg = Copies[Copies.size() - 5];
   Register CopyValBfxReg = Copies[Copies.size() - 4];
   Register CopyUnkBfxReg = Copies[Copies.size() - 3];
@@ -1839,7 +1839,7 @@ TEST_F(AMDGPUGISelMITest, TestKnownBitsSBFX) {
                         "  %sbfx_copy_unk_width:_(s32) = COPY %13\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyBfxReg = Copies[Copies.size() - 5];
   Register CopyValBfxReg = Copies[Copies.size() - 4];
   Register CopyNegValBfxReg = Copies[Copies.size() - 3];
@@ -1899,7 +1899,7 @@ TEST_F(AMDGPUGISelMITest, TestNumSignBitsUBFX) {
                         "  %ubfx_copy_unk_width:_(s32) = COPY %13\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyUnkBfxReg = Copies[Copies.size() - 5];
   Register CopyPosBfxReg = Copies[Copies.size() - 4];
   Register CopyNegBfxReg = Copies[Copies.size() - 3];
@@ -1933,7 +1933,7 @@ TEST_F(AMDGPUGISelMITest, TestNumSignBitsSBFX) {
                         "  %sbfx_copy_unk_off:_(s32) = COPY %13\n";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyNegBfxReg = Copies[Copies.size() - 5];
   Register CopyPosBfxReg = Copies[Copies.size() - 4];
   Register CopyHiSetBfxReg = Copies[Copies.size() - 3];
@@ -1970,7 +1970,7 @@ TEST_F(AMDGPUGISelMITest, TestKnownBitsAssertAlign) {
 )MIR";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   GISelKnownBits Info(*MF);
 
   KnownBits Res;
@@ -2008,7 +2008,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsUADDO) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyOverflow = Copies[Copies.size() - 1];
   GISelKnownBits Info(*MF);

diff  --git a/llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp b/llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp
index bddeb1342f0d9..fbbdf03d82f84 100644
--- a/llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp
@@ -28,7 +28,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsBuildVector) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -69,7 +69,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorCstPHI) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -105,7 +105,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorCstPHIToNonGenericReg) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -141,7 +141,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorUnknownPHI) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -179,7 +179,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorCstPHIWithLoop) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -212,7 +212,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorDecreasingCstPHIWithLoop) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
   Register SrcReg = FinalCopy->getOperand(1).getReg();
@@ -249,7 +249,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorAND) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -282,7 +282,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorOR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -315,7 +315,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorXOR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -343,7 +343,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorXORConstant) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   GISelKnownBits Info(*MF);
   Register CopySplatReg = Copies[Copies.size() - 2];
@@ -388,7 +388,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorASHR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 2];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -433,7 +433,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorLSHR) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 2];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -469,7 +469,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorSHL) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -502,7 +502,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorADD) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -535,7 +535,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorSUB) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -564,7 +564,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorMUL) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -599,7 +599,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorSelect) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -613,7 +613,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorSelect) {
 TEST_F(AArch64GISelMITest, TestVectorSignBitIsZero) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const LLT V2S32 = LLT::fixed_vector(2, 32);
   // Vector buildConstant makes splat G_BUILD_VECTOR instruction.
@@ -672,7 +672,7 @@ TEST_F(AArch64GISelMITest, TestVectorNumSignBitsConstant) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg1 = Copies[Copies.size() - 7];
   Register CopyRegNeg1 = Copies[Copies.size() - 6];
@@ -715,7 +715,7 @@ TEST_F(AArch64GISelMITest, TestVectorNumSignBitsSext) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopySextLoad = Copies[Copies.size() - 3];
   Register CopySextNeg1 = Copies[Copies.size() - 2];
   Register CopySextNonSplat = Copies[Copies.size() - 1];
@@ -764,7 +764,7 @@ TEST_F(AArch64GISelMITest, TestVectorNumSignBitsSextInReg) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyInReg7 = Copies[Copies.size() - 9];
   Register CopyInReg8 = Copies[Copies.size() - 8];
@@ -831,7 +831,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsVectorAssertSext) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyInReg1 = Copies[Copies.size() - 10];
   Register CopyInReg7 = Copies[Copies.size() - 9];
@@ -879,7 +879,7 @@ TEST_F(AArch64GISelMITest, TestVectorNumSignBitsTrunc) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyTruncLoad = Copies[Copies.size() - 3];
   Register CopyTruncNeg1 = Copies[Copies.size() - 2];
@@ -942,7 +942,7 @@ TEST_F(AMDGPUGISelMITest, TestVectorIsKnownToBeAPowerOfTwo) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   GISelKnownBits KB(*MF);
 
@@ -991,7 +991,7 @@ TEST_F(AArch64GISelMITest, TestVectorMetadata) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy = MRI->getVRegDef(CopyReg);
@@ -1040,7 +1040,7 @@ TEST_F(AArch64GISelMITest, TestVectorKnownBitsExt) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   Register CopyRegAny = Copies[Copies.size() - 3];
   Register CopyRegZ = Copies[Copies.size() - 2];
   Register CopyRegS = Copies[Copies.size() - 1];
@@ -1113,7 +1113,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorSextInReg) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   GISelKnownBits Info(*MF);
   KnownBits Res;
   auto GetKB = [&](unsigned Idx) {
@@ -1181,7 +1181,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorAssertSext) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
   GISelKnownBits Info(*MF);
   KnownBits Res;
   auto GetKB = [&](unsigned Idx) {
@@ -1226,7 +1226,7 @@ TEST_F(AArch64GISelMITest, TestVectorKnownBitsBSwapBitReverse) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const uint32_t ByteSwappedVal = 0x44332211;
   const uint32_t BitSwappedVal = 0x22cc4488;
@@ -1284,7 +1284,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorUMAX) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 2];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1314,7 +1314,7 @@ TEST_F(AArch64GISelMITest, TestVectorKnownBitsUMax) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyUMax = Copies[Copies.size() - 1];
   GISelKnownBits Info(*MF);
@@ -1350,7 +1350,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorUMIN) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1383,7 +1383,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorSMAX) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1416,7 +1416,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorSMIN) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyReg0 = Copies[Copies.size() - 1];
   MachineInstr *FinalCopy0 = MRI->getVRegDef(CopyReg0);
@@ -1441,7 +1441,7 @@ TEST_F(AArch64GISelMITest, TestVectorInvalidQueries) {
 )";
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register EqSizedCopyReg = Copies[Copies.size() - 2];
   MachineInstr *EqSizedCopy = MRI->getVRegDef(EqSizedCopyReg);
@@ -1483,7 +1483,7 @@ TEST_F(AArch64GISelMITest, TestKnownBitsVectorAssertZext) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyAssert8 = Copies[Copies.size() - 4];
   Register CopyAssert1 = Copies[Copies.size() - 3];
@@ -1539,7 +1539,7 @@ TEST_F(AArch64GISelMITest, TestNumSignBitsUAddoOverflow) {
 
   setUp(MIRString);
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register CopyOverflow = Copies[Copies.size() - 1];
 

diff  --git a/llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp b/llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
index 4eb9d3bb7b62a..3fb10db7f6665 100644
--- a/llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
@@ -28,7 +28,7 @@ class DummyGISelObserver : public GISelChangeObserver {
 TEST_F(AArch64GISelMITest, LowerRotates) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -81,7 +81,7 @@ TEST_F(AArch64GISelMITest, LowerRotates) {
 TEST_F(AArch64GISelMITest, LowerRotatesNonPow2) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -138,7 +138,7 @@ TEST_F(AArch64GISelMITest, LowerRotatesNonPow2) {
 TEST_F(AArch64GISelMITest, LowerRotatesVector) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -185,7 +185,7 @@ TEST_F(AArch64GISelMITest, LowerRotatesVector) {
 TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ0) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -217,7 +217,7 @@ TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ0) {
 TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ1) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -251,7 +251,7 @@ TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ1) {
 TEST_F(AArch64GISelMITest, NarrowScalarCTLZ) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -286,7 +286,7 @@ TEST_F(AArch64GISelMITest, NarrowScalarCTLZ) {
 TEST_F(AArch64GISelMITest, NarrowScalarCTTZ) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -321,7 +321,7 @@ TEST_F(AArch64GISelMITest, NarrowScalarCTTZ) {
 TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ2) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -354,7 +354,7 @@ TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ2) {
 TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP1) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -388,7 +388,7 @@ TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP1) {
 TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP2) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -423,7 +423,7 @@ TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP2) {
 TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ3) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -450,7 +450,7 @@ TEST_F(AArch64GISelMITest, LowerBitCountingCTTZ3) {
 TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ0) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -481,7 +481,7 @@ TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ0) {
 TEST_F(AArch64GISelMITest, LowerBitCountingCTLZLibcall) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -512,7 +512,7 @@ TEST_F(AArch64GISelMITest, LowerBitCountingCTLZLibcall) {
 TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ1) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -553,7 +553,7 @@ TEST_F(AArch64GISelMITest, LowerBitCountingCTLZ1) {
 TEST_F(AArch64GISelMITest, WidenBitCountingCTLZ) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -588,7 +588,7 @@ TEST_F(AArch64GISelMITest, WidenBitCountingCTLZ) {
 TEST_F(AArch64GISelMITest, WidenBitCountingCTLZZeroUndef) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -624,7 +624,7 @@ TEST_F(AArch64GISelMITest, WidenBitCountingCTLZZeroUndef) {
 TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -657,7 +657,7 @@ TEST_F(AArch64GISelMITest, WidenBitCountingCTPOP) {
 TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ_ZERO_UNDEF) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -691,7 +691,7 @@ TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ_ZERO_UNDEF) {
 TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -725,7 +725,7 @@ TEST_F(AArch64GISelMITest, WidenBitCountingCTTZ) {
 TEST_F(AArch64GISelMITest, WidenUADDO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -764,7 +764,7 @@ TEST_F(AArch64GISelMITest, WidenUADDO) {
 TEST_F(AArch64GISelMITest, WidenUSUBO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -803,7 +803,7 @@ TEST_F(AArch64GISelMITest, WidenUSUBO) {
 TEST_F(AArch64GISelMITest, WidenSADDO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -842,7 +842,7 @@ TEST_F(AArch64GISelMITest, WidenSADDO) {
 TEST_F(AArch64GISelMITest, WidenSSUBO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -880,7 +880,7 @@ TEST_F(AArch64GISelMITest, WidenSSUBO) {
 TEST_F(AArch64GISelMITest, WidenUADDE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -920,7 +920,7 @@ TEST_F(AArch64GISelMITest, WidenUADDE) {
 TEST_F(AArch64GISelMITest, WidenUSUBE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -960,7 +960,7 @@ TEST_F(AArch64GISelMITest, WidenUSUBE) {
 TEST_F(AArch64GISelMITest, WidenSADDE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -1000,7 +1000,7 @@ TEST_F(AArch64GISelMITest, WidenSADDE) {
 TEST_F(AArch64GISelMITest, WidenSSUBE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -1040,7 +1040,7 @@ TEST_F(AArch64GISelMITest, WidenSSUBE) {
 TEST_F(AArch64GISelMITest, WidenUMULOCondition) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -1075,7 +1075,7 @@ TEST_F(AArch64GISelMITest, WidenUMULOCondition) {
 TEST_F(AArch64GISelMITest, NarrowUADDO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1112,7 +1112,7 @@ TEST_F(AArch64GISelMITest, NarrowUADDO) {
 TEST_F(AArch64GISelMITest, NarrowUSUBO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1149,7 +1149,7 @@ TEST_F(AArch64GISelMITest, NarrowUSUBO) {
 TEST_F(AArch64GISelMITest, NarrowSADDO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1186,7 +1186,7 @@ TEST_F(AArch64GISelMITest, NarrowSADDO) {
 TEST_F(AArch64GISelMITest, NarrowSSUBO) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1223,7 +1223,7 @@ TEST_F(AArch64GISelMITest, NarrowSSUBO) {
 TEST_F(AArch64GISelMITest, NarrowUADDE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1262,7 +1262,7 @@ TEST_F(AArch64GISelMITest, NarrowUADDE) {
 TEST_F(AArch64GISelMITest, NarrowUSUBE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1301,7 +1301,7 @@ TEST_F(AArch64GISelMITest, NarrowUSUBE) {
 TEST_F(AArch64GISelMITest, NarrowSADDE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1340,7 +1340,7 @@ TEST_F(AArch64GISelMITest, NarrowSADDE) {
 TEST_F(AArch64GISelMITest, NarrowSSUBE) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -1379,7 +1379,7 @@ TEST_F(AArch64GISelMITest, NarrowSSUBE) {
 TEST_F(AArch64GISelMITest, FewerElementsAnd) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const LLT V2S32 = LLT::fixed_vector(2, 32);
   const LLT V5S32 = LLT::fixed_vector(5, 32);
@@ -1425,7 +1425,7 @@ TEST_F(AArch64GISelMITest, FewerElementsAnd) {
 TEST_F(AArch64GISelMITest, MoreElementsAnd) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s32 = LLT::scalar(32);
   LLT v2s32 = LLT::fixed_vector(2, 32);
@@ -1475,7 +1475,7 @@ TEST_F(AArch64GISelMITest, MoreElementsAnd) {
 TEST_F(AArch64GISelMITest, FewerElementsPhi) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s1 = LLT::scalar(1);
   LLT s32 = LLT::scalar(32);
@@ -1572,7 +1572,7 @@ TEST_F(AArch64GISelMITest, FewerElementsPhi) {
 TEST_F(AArch64GISelMITest, LowerFNEG) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -1620,7 +1620,7 @@ TEST_F(AArch64GISelMITest, LowerFNEG) {
 TEST_F(AArch64GISelMITest, LowerMinMax) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   LLT v2s32 = LLT::fixed_vector(2, 32);
@@ -1707,7 +1707,7 @@ TEST_F(AArch64GISelMITest, LowerMinMax) {
 TEST_F(AArch64GISelMITest, WidenScalarBuildVector) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S32 = LLT::scalar(32);
   LLT S16 = LLT::scalar(16);
@@ -1756,7 +1756,7 @@ TEST_F(AArch64GISelMITest, WidenScalarBuildVector) {
 TEST_F(AArch64GISelMITest, LowerMergeValues) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const LLT S32 = LLT::scalar(32);
   const LLT S24 = LLT::scalar(24);
@@ -1861,7 +1861,7 @@ TEST_F(AArch64GISelMITest, LowerMergeValues) {
 TEST_F(AArch64GISelMITest, WidenScalarMergeValuesPointer) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -1900,7 +1900,7 @@ TEST_F(AArch64GISelMITest, WidenScalarMergeValuesPointer) {
 TEST_F(AArch64GISelMITest, WidenSEXTINREG) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -1933,7 +1933,7 @@ TEST_F(AArch64GISelMITest, WidenSEXTINREG) {
 TEST_F(AArch64GISelMITest, NarrowSEXTINREG) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info, these aren't actually relevant to the test.
   DefineLegalizerInfo(A, {
@@ -1966,7 +1966,7 @@ TEST_F(AArch64GISelMITest, NarrowSEXTINREG) {
 TEST_F(AArch64GISelMITest, NarrowSEXTINREG2) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info, these aren't actually relevant to the test.
   DefineLegalizerInfo(
@@ -2000,7 +2000,7 @@ TEST_F(AArch64GISelMITest, NarrowSEXTINREG2) {
 TEST_F(AArch64GISelMITest, LowerSEXTINREG) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info, these aren't actually relevant to the test.
   DefineLegalizerInfo(
@@ -2032,7 +2032,7 @@ TEST_F(AArch64GISelMITest, LowerSEXTINREG) {
 TEST_F(AArch64GISelMITest, LibcallFPExt) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2072,7 +2072,7 @@ TEST_F(AArch64GISelMITest, LibcallFPExt) {
 TEST_F(AArch64GISelMITest, LibcallFPTrunc) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2115,7 +2115,7 @@ TEST_F(AArch64GISelMITest, LibcallFPTrunc) {
 TEST_F(AArch64GISelMITest, LibcallSimple) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2139,7 +2139,7 @@ TEST_F(AArch64GISelMITest, LibcallSimple) {
 TEST_F(AArch64GISelMITest, LibcallMul) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2197,7 +2197,7 @@ TEST_F(AArch64GISelMITest, LibcallMul) {
 TEST_F(AArch64GISelMITest, LibcallSRem) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2255,7 +2255,7 @@ TEST_F(AArch64GISelMITest, LibcallSRem) {
 TEST_F(AArch64GISelMITest, LibcallURem) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2313,7 +2313,7 @@ TEST_F(AArch64GISelMITest, LibcallURem) {
 TEST_F(AArch64GISelMITest, LibcallCtlzZeroUndef) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2367,7 +2367,7 @@ TEST_F(AArch64GISelMITest, LibcallCtlzZeroUndef) {
 TEST_F(AArch64GISelMITest, LibcallFAdd) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2420,7 +2420,7 @@ TEST_F(AArch64GISelMITest, LibcallFAdd) {
 TEST_F(AArch64GISelMITest, LibcallFSub) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2473,7 +2473,7 @@ TEST_F(AArch64GISelMITest, LibcallFSub) {
 TEST_F(AArch64GISelMITest, LibcallFMul) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2526,7 +2526,7 @@ TEST_F(AArch64GISelMITest, LibcallFMul) {
 TEST_F(AArch64GISelMITest, LibcallFDiv) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2579,7 +2579,7 @@ TEST_F(AArch64GISelMITest, LibcallFDiv) {
 TEST_F(AArch64GISelMITest, LibcallFExp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2627,7 +2627,7 @@ TEST_F(AArch64GISelMITest, LibcallFExp) {
 TEST_F(AArch64GISelMITest, LibcallFExp2) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2675,7 +2675,7 @@ TEST_F(AArch64GISelMITest, LibcallFExp2) {
 TEST_F(AArch64GISelMITest, LibcallFRem) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2723,7 +2723,7 @@ TEST_F(AArch64GISelMITest, LibcallFRem) {
 TEST_F(AArch64GISelMITest, LibcallFPow) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2771,7 +2771,7 @@ TEST_F(AArch64GISelMITest, LibcallFPow) {
 TEST_F(AArch64GISelMITest, LibcallFMa) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2820,7 +2820,7 @@ TEST_F(AArch64GISelMITest, LibcallFMa) {
 TEST_F(AArch64GISelMITest, LibcallFCeil) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2868,7 +2868,7 @@ TEST_F(AArch64GISelMITest, LibcallFCeil) {
 TEST_F(AArch64GISelMITest, LibcallFFloor) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2916,7 +2916,7 @@ TEST_F(AArch64GISelMITest, LibcallFFloor) {
 TEST_F(AArch64GISelMITest, LibcallFMinNum) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -2967,7 +2967,7 @@ TEST_F(AArch64GISelMITest, LibcallFMinNum) {
 TEST_F(AArch64GISelMITest, LibcallFMaxNum) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -3018,7 +3018,7 @@ TEST_F(AArch64GISelMITest, LibcallFMaxNum) {
 TEST_F(AArch64GISelMITest, LibcallFSqrt) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -3066,7 +3066,7 @@ TEST_F(AArch64GISelMITest, LibcallFSqrt) {
 TEST_F(AArch64GISelMITest, LibcallFRint) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -3114,7 +3114,7 @@ TEST_F(AArch64GISelMITest, LibcallFRint) {
 TEST_F(AArch64GISelMITest, LibcallFNearbyInt) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -3165,7 +3165,7 @@ TEST_F(AArch64GISelMITest, LibcallFNearbyInt) {
 TEST_F(AArch64GISelMITest, NarrowScalarExtract) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {
@@ -3204,7 +3204,7 @@ TEST_F(AArch64GISelMITest, NarrowScalarExtract) {
 TEST_F(AArch64GISelMITest, LowerInsert) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, { getActionDefinitionsBuilder(G_INSERT).lower(); });
@@ -3299,7 +3299,7 @@ TEST_F(AArch64GISelMITest, LowerInsert) {
 TEST_F(AArch64GISelMITest, LowerFFloor) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(A, {});
@@ -3331,7 +3331,7 @@ TEST_F(AArch64GISelMITest, LowerFFloor) {
 TEST_F(AArch64GISelMITest, LowerBSWAP) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3373,7 +3373,7 @@ TEST_F(AArch64GISelMITest, LowerBSWAP) {
 TEST_F(AArch64GISelMITest, LowerSDIVREM) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(
@@ -3404,7 +3404,7 @@ TEST_F(AArch64GISelMITest, LowerSDIVREM) {
 TEST_F(AArch64GISelMITest, LowerUDIVREM) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Declare your legalization info
   DefineLegalizerInfo(
@@ -3435,7 +3435,7 @@ TEST_F(AArch64GISelMITest, LowerUDIVREM) {
 TEST_F(AArch64GISelMITest, WidenUnmerge) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3483,7 +3483,7 @@ TEST_F(AArch64GISelMITest, WidenUnmerge) {
 TEST_F(AArch64GISelMITest, BitcastLoad) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT P0 = LLT::pointer(0, 64);
   LLT S32 = LLT::scalar(32);
@@ -3517,7 +3517,7 @@ TEST_F(AArch64GISelMITest, BitcastLoad) {
 TEST_F(AArch64GISelMITest, BitcastStore) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT P0 = LLT::pointer(0, 64);
   LLT S32 = LLT::scalar(32);
@@ -3551,7 +3551,7 @@ TEST_F(AArch64GISelMITest, BitcastStore) {
 TEST_F(AArch64GISelMITest, BitcastSelect) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S32 = LLT::scalar(32);
@@ -3598,7 +3598,7 @@ TEST_F(AArch64GISelMITest, BitcastSelect) {
 TEST_F(AArch64GISelMITest, BitcastBitOps) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S32 = LLT::scalar(32);
   LLT V4S8 = LLT::fixed_vector(4, 8);
@@ -3650,7 +3650,7 @@ TEST_F(AArch64GISelMITest, BitcastBitOps) {
 TEST_F(AArch64GISelMITest, CreateLibcall) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3677,7 +3677,7 @@ TEST_F(AArch64GISelMITest, CreateLibcall) {
 TEST_F(AArch64GISelMITest, NarrowImplicitDef) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3741,7 +3741,7 @@ TEST_F(AArch64GISelMITest, NarrowImplicitDef) {
 TEST_F(AArch64GISelMITest, WidenFreeze) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3791,7 +3791,7 @@ TEST_F(AArch64GISelMITest, WidenFreeze) {
 TEST_F(AArch64GISelMITest, NarrowFreeze) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3875,7 +3875,7 @@ TEST_F(AArch64GISelMITest, NarrowFreeze) {
 TEST_F(AArch64GISelMITest, FewerElementsFreeze) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3928,7 +3928,7 @@ TEST_F(AArch64GISelMITest, FewerElementsFreeze) {
 TEST_F(AArch64GISelMITest, MoreElementsFreeze) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -3966,7 +3966,7 @@ TEST_F(AArch64GISelMITest, MoreElementsFreeze) {
 TEST_F(AArch64GISelMITest, FewerElementsInsertVectorElt) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -4050,7 +4050,7 @@ TEST_F(AArch64GISelMITest, FewerElementsInsertVectorElt) {
 TEST_F(AArch64GISelMITest, widenScalarUnmerge) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -4094,7 +4094,7 @@ TEST_F(AArch64GISelMITest, widenScalarUnmerge) {
 TEST_F(AArch64GISelMITest, moreElementsShuffle) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -4146,7 +4146,7 @@ TEST_F(AArch64GISelMITest, moreElementsShuffle) {
 TEST_F(AArch64GISelMITest, narrowScalarShiftByConstant) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   DefineLegalizerInfo(A, {});
 
@@ -4188,7 +4188,7 @@ TEST_F(AArch64GISelMITest, narrowScalarShiftByConstant) {
 TEST_F(AArch64GISelMITest, MoreElementsSelect) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s1 = LLT::scalar(1);
   LLT s64 = LLT::scalar(64);

diff  --git a/llvm/unittests/CodeGen/GlobalISel/LegalizerTest.cpp b/llvm/unittests/CodeGen/GlobalISel/LegalizerTest.cpp
index 594f0c75b2490..8e13616512ea6 100644
--- a/llvm/unittests/CodeGen/GlobalISel/LegalizerTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/LegalizerTest.cpp
@@ -61,7 +61,7 @@ TEST_F(AArch64GISelMITest, BasicLegalizerTest) {
   )";
   setUp(MIRString.rtrim(' '));
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   ALegalizerInfo LI(MF->getSubtarget());
   LostDebugLocObserver LocObserver(DEBUG_TYPE);
@@ -98,7 +98,7 @@ TEST_F(AArch64GISelMITest, UnorderedArtifactCombiningTest) {
   )";
   setUp(MIRString.rtrim(' '));
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   ALegalizerInfo LI(MF->getSubtarget());
   LostDebugLocObserver LocObserver(DEBUG_TYPE);
@@ -191,7 +191,7 @@ TEST_F(AArch64GISelMITest, UnorderedArtifactCombiningManyCopiesTest) {
   )";
   setUp(MIRString.rtrim(' '));
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   ALegalizerInfo LI(MF->getSubtarget());
   LostDebugLocObserver LocObserver(DEBUG_TYPE);

diff  --git a/llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp b/llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp
index 421aaec07cb25..3afcaa1de7a18 100644
--- a/llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp
@@ -12,7 +12,7 @@
 TEST_F(AArch64GISelMITest, TestBuildConstantFConstant) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   B.buildConstant(LLT::scalar(32), 42);
   B.buildFConstant(LLT::scalar(32), 1.0);
@@ -43,7 +43,7 @@ TEST_F(AArch64GISelMITest, TestBuildConstantFConstant) {
 TEST_F(AArch64GISelMITest, TestBuildConstantFConstantDeath) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLVMContext &Ctx = MF->getFunction().getContext();
   APInt APV32(32, 12345);
@@ -75,7 +75,7 @@ TEST_F(AArch64GISelMITest, TestBuildConstantFConstantDeath) {
 TEST_F(AArch64GISelMITest, DstOpSrcOp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   SmallVector<Register, 4> Copies;
   collectCopies(Copies, MF);
@@ -101,7 +101,7 @@ TEST_F(AArch64GISelMITest, DstOpSrcOp) {
 TEST_F(AArch64GISelMITest, BuildUnmerge) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   SmallVector<Register, 4> Copies;
   collectCopies(Copies, MF);
@@ -122,7 +122,7 @@ TEST_F(AArch64GISelMITest, BuildUnmerge) {
 TEST_F(AArch64GISelMITest, TestBuildFPInsts) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   SmallVector<Register, 4> Copies;
   collectCopies(Copies, MF);
@@ -158,7 +158,7 @@ TEST_F(AArch64GISelMITest, TestBuildFPInsts) {
 TEST_F(AArch64GISelMITest, BuildIntrinsic) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S64 = LLT::scalar(64);
   SmallVector<Register, 4> Copies;
@@ -187,7 +187,7 @@ TEST_F(AArch64GISelMITest, BuildIntrinsic) {
 TEST_F(AArch64GISelMITest, BuildXor) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S64 = LLT::scalar(64);
   LLT S128 = LLT::scalar(128);
@@ -216,7 +216,7 @@ TEST_F(AArch64GISelMITest, BuildXor) {
 TEST_F(AArch64GISelMITest, BuildBitCounts) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S32 = LLT::scalar(32);
   SmallVector<Register, 4> Copies;
@@ -244,7 +244,7 @@ TEST_F(AArch64GISelMITest, BuildBitCounts) {
 TEST_F(AArch64GISelMITest, BuildCasts) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S32 = LLT::scalar(32);
   SmallVector<Register, 4> Copies;
@@ -269,7 +269,7 @@ TEST_F(AArch64GISelMITest, BuildCasts) {
 TEST_F(AArch64GISelMITest, BuildMinMaxAbs) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S64 = LLT::scalar(64);
   SmallVector<Register, 4> Copies;
@@ -297,7 +297,7 @@ TEST_F(AArch64GISelMITest, BuildMinMaxAbs) {
 TEST_F(AArch64GISelMITest, BuildAtomicRMW) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S64 = LLT::scalar(64);
   LLT P0 = LLT::pointer(0, 64);
@@ -327,7 +327,7 @@ TEST_F(AArch64GISelMITest, BuildAtomicRMW) {
 TEST_F(AArch64GISelMITest, BuildMergeLikeInstr) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S32 = LLT::scalar(32);
   Register RegC0 = B.buildConstant(S32, 0).getReg(0);
@@ -366,7 +366,7 @@ using MachineIRBuilderDeathTest = AArch64GISelMITest;
 TEST_F(MachineIRBuilderDeathTest, BuildMergeValues) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S32 = LLT::scalar(32);
   Register RegC0 = B.buildConstant(S32, 0).getReg(0);
@@ -397,7 +397,7 @@ TEST_F(MachineIRBuilderDeathTest, BuildMergeValues) {
 TEST_F(AArch64GISelMITest, BuildAddoSubo) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT S1 = LLT::scalar(1);
   LLT S64 = LLT::scalar(64);
@@ -433,7 +433,7 @@ TEST_F(AArch64GISelMITest, BuildAddoSubo) {
 TEST_F(AArch64GISelMITest, BuildBitfieldExtract) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   LLT S64 = LLT::scalar(64);
   SmallVector<Register, 4> Copies;
   collectCopies(Copies, MF);

diff  --git a/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp b/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
index c910fae4fc575..f52e49df0bcde 100644
--- a/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
+++ b/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp
@@ -32,7 +32,7 @@ namespace {
 TEST_F(AArch64GISelMITest, MatchIntConstant) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   auto MIBCst = B.buildConstant(LLT::scalar(64), 42);
   int64_t Cst;
   bool match = mi_match(MIBCst.getReg(0), *MRI, m_ICst(Cst));
@@ -43,7 +43,7 @@ TEST_F(AArch64GISelMITest, MatchIntConstant) {
 TEST_F(AArch64GISelMITest, MatchIntConstantRegister) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   auto MIBCst = B.buildConstant(LLT::scalar(64), 42);
   std::optional<ValueAndVReg> Src0;
   bool match = mi_match(MIBCst.getReg(0), *MRI, m_GCst(Src0));
@@ -54,7 +54,7 @@ TEST_F(AArch64GISelMITest, MatchIntConstantRegister) {
 TEST_F(AArch64GISelMITest, MatchIntConstantSplat) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   LLT v2s64 = LLT::fixed_vector(2, s64);
@@ -79,7 +79,7 @@ TEST_F(AArch64GISelMITest, MatchIntConstantSplat) {
 TEST_F(AArch64GISelMITest, MachineInstrPtrBind) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   auto MIBAdd = B.buildAdd(LLT::scalar(64), Copies[0], Copies[1]);
   // Test 'MachineInstr *' bind.
   // Default mi_match.
@@ -110,7 +110,7 @@ TEST_F(AArch64GISelMITest, MachineInstrPtrBind) {
 TEST_F(AArch64GISelMITest, MatchBinaryOp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   LLT s32 = LLT::scalar(32);
   LLT s64 = LLT::scalar(64);
   LLT p0 = LLT::pointer(0, 64);
@@ -282,7 +282,7 @@ TEST_F(AArch64GISelMITest, MatchBinaryOp) {
 TEST_F(AArch64GISelMITest, MatchICmp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const LLT s1 = LLT::scalar(1);
   auto CmpEq = B.buildICmp(CmpInst::ICMP_EQ, s1, Copies[0], Copies[1]);
@@ -307,7 +307,7 @@ TEST_F(AArch64GISelMITest, MatchICmp) {
 TEST_F(AArch64GISelMITest, MatchFCmp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   const LLT s1 = LLT::scalar(1);
   auto CmpEq = B.buildFCmp(CmpInst::FCMP_OEQ, s1, Copies[0], Copies[1]);
@@ -332,7 +332,7 @@ TEST_F(AArch64GISelMITest, MatchFCmp) {
 TEST_F(AArch64GISelMITest, MatcCommutativeICmp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   const LLT s1 = LLT::scalar(1);
   Register LHS = Copies[0];
   Register RHS = Copies[1];
@@ -361,7 +361,7 @@ TEST_F(AArch64GISelMITest, MatcCommutativeICmp) {
 TEST_F(AArch64GISelMITest, MatcCommutativeFCmp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   const LLT s1 = LLT::scalar(1);
   Register LHS = Copies[0];
   Register RHS = Copies[1];
@@ -390,7 +390,7 @@ TEST_F(AArch64GISelMITest, MatcCommutativeFCmp) {
 TEST_F(AArch64GISelMITest, MatchFPUnaryOp) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Truncate s64 to s32.
   LLT s32 = LLT::scalar(32);
@@ -452,7 +452,7 @@ TEST_F(AArch64GISelMITest, MatchFPUnaryOp) {
 TEST_F(AArch64GISelMITest, MatchExtendsTrunc) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   LLT s32 = LLT::scalar(32);
@@ -499,7 +499,7 @@ TEST_F(AArch64GISelMITest, MatchExtendsTrunc) {
 TEST_F(AArch64GISelMITest, MatchSpecificType) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Try to match a 64bit add.
   LLT s64 = LLT::scalar(64);
@@ -536,7 +536,7 @@ TEST_F(AArch64GISelMITest, MatchSpecificType) {
 TEST_F(AArch64GISelMITest, MatchCombinators) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   LLT s32 = LLT::scalar(32);
@@ -570,7 +570,7 @@ TEST_F(AArch64GISelMITest, MatchCombinators) {
 TEST_F(AArch64GISelMITest, MatchMiscellaneous) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   auto MIBAdd = B.buildAdd(s64, Copies[0], Copies[1]);
@@ -597,7 +597,7 @@ TEST_F(AArch64GISelMITest, MatchMiscellaneous) {
 TEST_F(AArch64GISelMITest, MatchSpecificConstant) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Basic case: Can we match a G_CONSTANT with a specific value?
   auto FortyTwo = B.buildConstant(LLT::scalar(64), 42);
@@ -619,7 +619,7 @@ TEST_F(AArch64GISelMITest, MatchSpecificConstant) {
 TEST_F(AArch64GISelMITest, MatchSpecificConstantSplat) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   LLT v4s64 = LLT::fixed_vector(4, s64);
@@ -649,7 +649,7 @@ TEST_F(AArch64GISelMITest, MatchSpecificConstantSplat) {
 TEST_F(AArch64GISelMITest, MatchSpecificConstantOrSplat) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   LLT v4s64 = LLT::fixed_vector(4, s64);
@@ -680,7 +680,7 @@ TEST_F(AArch64GISelMITest, MatchSpecificConstantOrSplat) {
 TEST_F(AArch64GISelMITest, MatchZeroInt) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   auto Zero = B.buildConstant(LLT::scalar(64), 0);
   EXPECT_TRUE(mi_match(Zero.getReg(0), *MRI, m_ZeroInt()));
 
@@ -691,7 +691,7 @@ TEST_F(AArch64GISelMITest, MatchZeroInt) {
 TEST_F(AArch64GISelMITest, MatchAllOnesInt) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   auto AllOnes = B.buildConstant(LLT::scalar(64), -1);
   EXPECT_TRUE(mi_match(AllOnes.getReg(0), *MRI, m_AllOnesInt()));
 
@@ -702,7 +702,7 @@ TEST_F(AArch64GISelMITest, MatchAllOnesInt) {
 TEST_F(AArch64GISelMITest, MatchFPOrIntConst) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   Register IntOne = B.buildConstant(LLT::scalar(64), 1).getReg(0);
   Register FPOne = B.buildFConstant(LLT::scalar(64), 1.0).getReg(0);
@@ -721,7 +721,7 @@ TEST_F(AArch64GISelMITest, MatchFPOrIntConst) {
 TEST_F(AArch64GISelMITest, MatchConstantSplat) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   LLT v2s64 = LLT::fixed_vector(2, 64);
@@ -811,7 +811,7 @@ TEST_F(AArch64GISelMITest, MatchConstantSplat) {
 TEST_F(AArch64GISelMITest, MatchNeg) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   auto Zero = B.buildConstant(LLT::scalar(64), 0);
@@ -843,7 +843,7 @@ TEST_F(AArch64GISelMITest, MatchNeg) {
 TEST_F(AArch64GISelMITest, MatchNot) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   LLT s64 = LLT::scalar(64);
   auto AllOnes = B.buildConstant(LLT::scalar(64), -1);
@@ -876,7 +876,7 @@ TEST_F(AArch64GISelMITest, MatchNot) {
 TEST_F(AArch64GISelMITest, MatchSpecificReg) {
   setUp();
   if (!TM)
-    return;
+    GTEST_SKIP();
   auto Cst1 = B.buildConstant(LLT::scalar(64), 42);
   auto Cst2 = B.buildConstant(LLT::scalar(64), 314);
   Register Reg = Cst1.getReg(0);

diff  --git a/llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp b/llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp
index f0e1552a13787..8af3050a4273f 100644
--- a/llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp
+++ b/llvm/unittests/DebugInfo/LogicalView/ELFReaderTest.cpp
@@ -338,7 +338,7 @@ TEST(LogicalViewTest, ELFReader) {
 
   std::string TargetLookupError;
   if (!TargetRegistry::lookupTarget(std::string(TT.str()), TargetLookupError))
-    return;
+    GTEST_SKIP();
 
   SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0);
 

diff  --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp b/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
index 06d59903ac2fc..35e9e3ac95040 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp
@@ -386,7 +386,7 @@ TEST_F(MCJITCAPITest, stackmap_creates_compact_unwind_on_darwin) {
   
   // This test is also not supported on non-x86 platforms.
   if (Triple(HostTriple).getArch() != Triple::x86_64)
-    return;
+    GTEST_SKIP();
   
   buildFunctionThatUsesStackmap();
   buildMCJITOptions();

diff  --git a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
index 6a4cd4823aa58..43495ed3d1720 100644
--- a/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
+++ b/llvm/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
@@ -30,7 +30,7 @@
 #define SKIP_UNSUPPORTED_PLATFORM \
   do \
     if (!ArchSupportsMCJIT() || !OSSupportsMCJIT() || !HostCanBeTargeted()) \
-      return; \
+      GTEST_SKIP(); \
   while(0)
 
 namespace llvm {

diff  --git a/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp
index 81ff3e7a87b30..a5afd8231045f 100644
--- a/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp
@@ -23,14 +23,14 @@ TEST_F(LazyReexportsTest, BasicLocalCallThroughManagerOperation) {
   // Bail out if we can not detect the host.
   if (!JTMB) {
     consumeError(JTMB.takeError());
-    return;
+    GTEST_SKIP();
   }
 
   // Bail out if we can not build a local call-through manager.
   auto LCTM = createLocalLazyCallThroughManager(JTMB->getTargetTriple(), ES, 0);
   if (!LCTM) {
     consumeError(LCTM.takeError());
-    return;
+    GTEST_SKIP();
   }
 
   auto DummyTarget = ES.intern("DummyTarget");

diff  --git a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
index bff096915af6a..82d6968ea9874 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
@@ -90,7 +90,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestSetProcessAllSections) {
   std::unique_ptr<TargetMachine> TM(EngineBuilder().selectTarget(
       Triple(M->getTargetTriple()), "", "", SmallVector<std::string, 1>()));
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   auto Obj = cantFail(SimpleCompiler(*TM)(*M));
 
@@ -110,7 +110,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestOverrideObjectFlags) {
                                    SmallVector<std::string, 1>()));
 
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Our compiler is going to modify symbol visibility settings without telling
   // ORC. This will test our ability to override the flags later.
@@ -183,7 +183,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestAutoClaimResponsibilityForSymbols) {
                                    SmallVector<std::string, 1>()));
 
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   // Our compiler is going to add a new symbol without telling ORC.
   // This will test our ability to auto-claim responsibility later.

diff  --git a/llvm/unittests/MC/Disassembler.cpp b/llvm/unittests/MC/Disassembler.cpp
index 3f9e6e5501e16..a02931a8acfea 100644
--- a/llvm/unittests/MC/Disassembler.cpp
+++ b/llvm/unittests/MC/Disassembler.cpp
@@ -32,7 +32,7 @@ TEST(Disassembler, X86Test) {
   LLVMDisasmContextRef DCR = LLVMCreateDisasm("x86_64-pc-linux", nullptr, 0,
                                               nullptr, symbolLookupCallback);
   if (!DCR)
-    return;
+    GTEST_SKIP();
 
   size_t InstSize;
   unsigned NumBytes = sizeof(Bytes);
@@ -78,7 +78,7 @@ TEST(Disassembler, WebAssemblyTest) {
   LLVMDisasmContextRef DCR = LLVMCreateDisasm("wasm32-unknown-unknown", nullptr,
                                               0, nullptr, symbolLookupCallback);
   if (!DCR)
-    return;
+    GTEST_SKIP();
 
   size_t InstSize;
   unsigned NumBytes = sizeof(Bytes);

diff  --git a/llvm/unittests/MC/DwarfLineTableHeaders.cpp b/llvm/unittests/MC/DwarfLineTableHeaders.cpp
index f45ad7229c176..ed3671aa6c97e 100644
--- a/llvm/unittests/MC/DwarfLineTableHeaders.cpp
+++ b/llvm/unittests/MC/DwarfLineTableHeaders.cpp
@@ -200,7 +200,7 @@ class DwarfLineTableHeaders : public ::testing::Test {
 
 TEST_F(DwarfLineTableHeaders, TestDWARF4HeaderEmission) {
   if (!MRI)
-    return;
+    GTEST_SKIP();
 
   SmallString<0> EmittedBinContents;
   raw_svector_ostream VecOS(EmittedBinContents);
@@ -224,7 +224,7 @@ TEST_F(DwarfLineTableHeaders, TestDWARF4HeaderEmission) {
 
 TEST_F(DwarfLineTableHeaders, TestDWARF5HeaderEmission) {
   if (!MRI)
-    return;
+    GTEST_SKIP();
 
   SmallString<0> EmittedBinContents;
   raw_svector_ostream VecOS(EmittedBinContents);

diff  --git a/llvm/unittests/MC/DwarfLineTables.cpp b/llvm/unittests/MC/DwarfLineTables.cpp
index 3c41228b72bc1..f16d20c790aa6 100644
--- a/llvm/unittests/MC/DwarfLineTables.cpp
+++ b/llvm/unittests/MC/DwarfLineTables.cpp
@@ -65,7 +65,7 @@ void verifyEncoding(MCDwarfLineTableParams Params, int LineDelta, int AddrDelta,
 
 TEST(DwarfLineTables, TestDefaultParams) {
   if (!getContext())
-    return;
+    GTEST_SKIP();
 
   MCDwarfLineTableParams Params;
 
@@ -115,7 +115,7 @@ TEST(DwarfLineTables, TestDefaultParams) {
 
 TEST(DwarfLineTables, TestCustomParams) {
   if (!getContext())
-    return;
+    GTEST_SKIP();
 
   // Some tests against the example values given in the standard.
   MCDwarfLineTableParams Params;
@@ -169,7 +169,7 @@ TEST(DwarfLineTables, TestCustomParams) {
 
 TEST(DwarfLineTables, TestCustomParams2) {
   if (!getContext())
-    return;
+    GTEST_SKIP();
 
   // Corner case param values.
   MCDwarfLineTableParams Params;

diff  --git a/llvm/unittests/MC/MCInstPrinter.cpp b/llvm/unittests/MC/MCInstPrinter.cpp
index 1b0ca2837ba86..bff58c46edb8c 100644
--- a/llvm/unittests/MC/MCInstPrinter.cpp
+++ b/llvm/unittests/MC/MCInstPrinter.cpp
@@ -61,7 +61,7 @@ class MCInstPrinterTest : public ::testing::Test {
 
 TEST_F(MCInstPrinterTest, formatHex) {
   if (!Printer)
-    return;
+    GTEST_SKIP();
 
   EXPECT_EQ("0x1", formatHex<int64_t>(1));
   EXPECT_EQ("0x7fffffffffffffff",

diff  --git a/llvm/unittests/Object/ArchiveTest.cpp b/llvm/unittests/Object/ArchiveTest.cpp
index 467ae69a9eda1..b4f2192ad31ac 100644
--- a/llvm/unittests/Object/ArchiveTest.cpp
+++ b/llvm/unittests/Object/ArchiveTest.cpp
@@ -56,7 +56,7 @@ TEST_F(ArchiveTestsFixture, ArchiveChildGetSizeRegularArchive) {
   // This test relies on a StringRef being able to hold the appropriate amount
   // of data.
   if (std::numeric_limits<StringRef::size_type>::max() < MemberSize)
-    return;
+    GTEST_SKIP();
 
   auto Child = createChild(ArchiveWithMember);
   ASSERT_THAT_EXPECTED(Child, Succeeded());
@@ -79,7 +79,7 @@ TEST_F(ArchiveTestsFixture, ArchiveChildGetBuffer) {
   // This test relies on a StringRef being able to hold the appropriate amount
   // of data.
   if (std::numeric_limits<StringRef::size_type>::max() < MemberSize)
-    return;
+    GTEST_SKIP();
 
   auto Child = createChild(ArchiveWithMember);
   ASSERT_THAT_EXPECTED(Child, Succeeded());

diff  --git a/llvm/unittests/Object/ELFObjectFileTest.cpp b/llvm/unittests/Object/ELFObjectFileTest.cpp
index 6316e180d5d97..110236ea92d47 100644
--- a/llvm/unittests/Object/ELFObjectFileTest.cpp
+++ b/llvm/unittests/Object/ELFObjectFileTest.cpp
@@ -474,7 +474,8 @@ TEST(ELFObjectFileTest, InvalidSymbolTest) {
 
 // Tests for error paths of the ELFFile::decodeBBAddrMap API.
 TEST(ELFObjectFileTest, InvalidDecodeBBAddrMap) {
-  if (IsHostWindows()) return;
+  if (IsHostWindows())
+    GTEST_SKIP();
   StringRef CommonYamlString(R"(
 --- !ELF
 FileHeader:
@@ -605,7 +606,8 @@ TEST(ELFObjectFileTest, InvalidDecodeBBAddrMap) {
 
 // Test for the ELFObjectFile::readBBAddrMap API.
 TEST(ELFObjectFileTest, ReadBBAddrMap) {
-  if (IsHostWindows()) return;
+  if (IsHostWindows())
+    GTEST_SKIP();
   StringRef CommonYamlString(R"(
 --- !ELF
 FileHeader:

diff  --git a/llvm/unittests/Passes/PluginsTest.cpp b/llvm/unittests/Passes/PluginsTest.cpp
index 5b3fef61c7187..2814dce9f2615 100644
--- a/llvm/unittests/Passes/PluginsTest.cpp
+++ b/llvm/unittests/Passes/PluginsTest.cpp
@@ -40,8 +40,8 @@ static std::string LibPath(const std::string Name = "TestPlugin") {
 
 TEST(PluginsTests, LoadPlugin) {
 #if !defined(LLVM_ENABLE_PLUGINS)
-  // Disable the test if plugins are disabled.
-  return;
+  // Skip the test if plugins are disabled.
+  GTEST_SKIP();
 #endif
 
   auto PluginPath = LibPath();
@@ -66,8 +66,8 @@ TEST(PluginsTests, LoadPlugin) {
 // -fpass-plugin=DoublerPlugin.
 TEST(PluginsTests, LoadMultiplePlugins) {
 #if !defined(LLVM_ENABLE_PLUGINS)
-  // Disable the test if plugins are disabled.
-  return;
+  // Skip the test if plugins are disabled.
+  GTEST_SKIP();
 #endif
 
   auto DoublerPluginPath = LibPath("DoublerPlugin");

diff  --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp
index 86a7047a991be..567866da6e19f 100644
--- a/llvm/unittests/ProfileData/InstrProfTest.cpp
+++ b/llvm/unittests/ProfileData/InstrProfTest.cpp
@@ -1253,14 +1253,14 @@ TEST(ProfileReaderTest, ReadsLargeFiles) {
 
   auto RawProfile = WritableMemoryBuffer::getNewUninitMemBuffer(LargeSize);
   if (!RawProfile)
-    return;
+    GTEST_SKIP();
   auto RawProfileReaderOrErr = InstrProfReader::create(std::move(RawProfile));
   ASSERT_TRUE(InstrProfError::take(RawProfileReaderOrErr.takeError()) ==
               instrprof_error::unrecognized_format);
 
   auto IndexedProfile = WritableMemoryBuffer::getNewUninitMemBuffer(LargeSize);
   if (!IndexedProfile)
-    return;
+    GTEST_SKIP();
   auto IndexedReaderOrErr =
       IndexedInstrProfReader::create(std::move(IndexedProfile), nullptr);
   ASSERT_TRUE(InstrProfError::take(IndexedReaderOrErr.takeError()) ==

diff  --git a/llvm/unittests/Support/CRCTest.cpp b/llvm/unittests/Support/CRCTest.cpp
index fb6dbc79f4b83..2a80191daaca8 100644
--- a/llvm/unittests/Support/CRCTest.cpp
+++ b/llvm/unittests/Support/CRCTest.cpp
@@ -50,7 +50,7 @@ TEST(CRCTest, LargeCRC32) {
   size_t TestSize = (size_t)UINT32_MAX + 42;
   uint8_t *TestData = (uint8_t*)calloc(TestSize, 1);
   if (!TestData)
-    return;
+    GTEST_SKIP();
 
   // Test expectation generated with:
   // $ truncate --size=`echo 2^32-1+42 | bc` /tmp/foo

diff  --git a/llvm/unittests/Support/MemoryTest.cpp b/llvm/unittests/Support/MemoryTest.cpp
index bcbbd285823ee..019ece9c17259 100644
--- a/llvm/unittests/Support/MemoryTest.cpp
+++ b/llvm/unittests/Support/MemoryTest.cpp
@@ -92,7 +92,7 @@ class MappedMemoryTest : public ::testing::TestWithParam<unsigned> {
   do { \
     if ((Flags & Memory::MF_WRITE) && (Flags & Memory::MF_EXEC) && \
         IsMPROTECT()) \
-      return; \
+      GTEST_SKIP();   \
   } while (0)
 
 TEST_P(MappedMemoryTest, AllocAndRelease) {
@@ -158,7 +158,7 @@ TEST_P(MappedMemoryTest, BasicWrite) {
   // This test applies only to readable and writeable combinations
   if (Flags &&
       !((Flags & Memory::MF_READ) && (Flags & Memory::MF_WRITE)))
-    return;
+    GTEST_SKIP();
   CHECK_UNSUPPORTED();
 
   std::error_code EC;
@@ -179,7 +179,7 @@ TEST_P(MappedMemoryTest, MultipleWrite) {
   // This test applies only to readable and writeable combinations
   if (Flags &&
       !((Flags & Memory::MF_READ) && (Flags & Memory::MF_WRITE)))
-    return;
+    GTEST_SKIP();
   CHECK_UNSUPPORTED();
 
   std::error_code EC;
@@ -243,7 +243,7 @@ TEST_P(MappedMemoryTest, EnabledWrite) {
   // MPROTECT prevents W+X, and since this test always adds W we need
   // to block any variant with X.
   if ((Flags & Memory::MF_EXEC) && IsMPROTECT())
-    return;
+    GTEST_SKIP();
 
   std::error_code EC;
   MemoryBlock M1 = Memory::allocateMappedMemory(2 * sizeof(int), nullptr, Flags,

diff  --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index 325bfc346ce46..f28e539472aea 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -499,7 +499,8 @@ TEST(Support, HomeDirectoryWithNoEnv) {
 
   // Don't run the test if we have nothing to compare against.
   struct passwd *pw = getpwuid(getuid());
-  if (!pw || !pw->pw_dir) return;
+  if (!pw || !pw->pw_dir)
+    GTEST_SKIP();
   std::string PwDir = pw->pw_dir;
 
   SmallString<128> HomeDir;

diff  --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp
index faaeea6d80fd9..0a3527df6de04 100644
--- a/llvm/unittests/Support/ThreadPool.cpp
+++ b/llvm/unittests/Support/ThreadPool.cpp
@@ -227,7 +227,7 @@ TEST_F(ThreadPoolTest, Groups) {
   // might block a thread until all tasks in group1 finish.
   ThreadPoolStrategy S = hardware_concurrency(2);
   if (S.compute_thread_count() < 2)
-    return;
+    GTEST_SKIP();
   ThreadPool Pool(S);
   PhaseResetHelper Helper(this);
   ThreadPoolTaskGroup Group1(Pool);
@@ -300,7 +300,7 @@ TEST_F(ThreadPoolTest, RecursiveWaitDeadlock) {
   CHECK_UNSUPPORTED();
   ThreadPoolStrategy S = hardware_concurrency(2);
   if (S.compute_thread_count() < 2)
-    return;
+    GTEST_SKIP();
   ThreadPool Pool(S);
   PhaseResetHelper Helper(this);
   ThreadPoolTaskGroup Group(Pool);
@@ -386,7 +386,7 @@ TEST_F(ThreadPoolTest, AllThreads_UseAllRessources) {
   // We cannot relibly ensure that all thread affinity mask are covered,
   // therefore this test should not run.
   if (llvm::RunningWindows11OrGreater())
-    return;
+    GTEST_SKIP();
   std::vector<llvm::BitVector> ThreadsUsed = RunOnAllSockets({});
   ASSERT_EQ(llvm::get_cpus(), ThreadsUsed.size());
 }
@@ -397,7 +397,7 @@ TEST_F(ThreadPoolTest, AllThreads_OneThreadPerCore) {
   // We cannot relibly ensure that all thread affinity mask are covered,
   // therefore this test should not run.
   if (llvm::RunningWindows11OrGreater())
-    return;
+    GTEST_SKIP();
   std::vector<llvm::BitVector> ThreadsUsed =
       RunOnAllSockets(llvm::heavyweight_hardware_concurrency());
   ASSERT_EQ(llvm::get_cpus(), ThreadsUsed.size());

diff  --git a/llvm/unittests/Target/AMDGPU/ExecMayBeModifiedBeforeAnyUse.cpp b/llvm/unittests/Target/AMDGPU/ExecMayBeModifiedBeforeAnyUse.cpp
index 5e926a4fa1639..ece288aaf06a0 100755
--- a/llvm/unittests/Target/AMDGPU/ExecMayBeModifiedBeforeAnyUse.cpp
+++ b/llvm/unittests/Target/AMDGPU/ExecMayBeModifiedBeforeAnyUse.cpp
@@ -16,7 +16,7 @@ using namespace llvm;
 TEST(AMDGPU, ExecMayBeModifiedBeforeAnyUse) {
   auto TM = createAMDGPUTargetMachine("amdgcn-amd-", "gfx906", "");
   if (!TM)
-    return;
+    GTEST_SKIP();
 
   GCNSubtarget ST(TM->getTargetTriple(), std::string(TM->getTargetCPU()),
                   std::string(TM->getTargetFeatureString()), *TM);

diff  --git a/llvm/unittests/Target/ARM/InstSizes.cpp b/llvm/unittests/Target/ARM/InstSizes.cpp
index eb13e8a752a25..cef9dc2f618e7 100644
--- a/llvm/unittests/Target/ARM/InstSizes.cpp
+++ b/llvm/unittests/Target/ARM/InstSizes.cpp
@@ -77,7 +77,7 @@ TEST(InstSizes, PseudoInst) {
   const Target *T = TargetRegistry::lookupTarget(TT, Error);
   if (!T) {
     dbgs() << Error;
-    return;
+    GTEST_SKIP();
   }
 
   TargetOptions Options;

diff  --git a/llvm/unittests/Target/ARM/MachineInstrTest.cpp b/llvm/unittests/Target/ARM/MachineInstrTest.cpp
index 636f7cfb2b10c..243b027d95a9c 100644
--- a/llvm/unittests/Target/ARM/MachineInstrTest.cpp
+++ b/llvm/unittests/Target/ARM/MachineInstrTest.cpp
@@ -79,7 +79,7 @@ TEST(MachineInstructionDoubleWidthResult, IsCorrect) {
   const Target *T = TargetRegistry::lookupTarget(TT, Error);
   if (!T) {
     dbgs() << Error;
-    return;
+    GTEST_SKIP();
   }
 
   TargetOptions Options;
@@ -235,7 +235,7 @@ TEST(MachineInstructionHorizontalReduction, IsCorrect) {
   const Target *T = TargetRegistry::lookupTarget(TT, Error);
   if (!T) {
     dbgs() << Error;
-    return;
+    GTEST_SKIP();
   }
 
   TargetOptions Options;
@@ -334,7 +334,7 @@ TEST(MachineInstructionRetainsPreviousHalfElement, IsCorrect) {
   const Target *T = TargetRegistry::lookupTarget(TT, Error);
   if (!T) {
     dbgs() << Error;
-    return;
+    GTEST_SKIP();
   }
 
   TargetOptions Options;
@@ -1040,7 +1040,7 @@ TEST(MachineInstrValidTailPredication, IsCorrect) {
   const Target *T = TargetRegistry::lookupTarget(TT, Error);
   if (!T) {
     dbgs() << Error;
-    return;
+    GTEST_SKIP();
   }
 
   TargetOptions Options;
@@ -1181,7 +1181,7 @@ TEST(MachineInstr, HasSideEffects) {
   const Target *T = TargetRegistry::lookupTarget(TT, Error);
   if (!T) {
     dbgs() << Error;
-    return;
+    GTEST_SKIP();
   }
 
   TargetOptions Options;
@@ -2061,7 +2061,7 @@ TEST(MachineInstr, MVEVecSize) {
   const Target *T = TargetRegistry::lookupTarget(TT, Error);
   if (!T) {
     dbgs() << Error;
-    return;
+    GTEST_SKIP();
   }
 
   TargetOptions Options;

diff  --git a/llvm/unittests/tools/llvm-cfi-verify/FileAnalysis.cpp b/llvm/unittests/tools/llvm-cfi-verify/FileAnalysis.cpp
index e57f87ecde833..aca9f393c7ec8 100644
--- a/llvm/unittests/tools/llvm-cfi-verify/FileAnalysis.cpp
+++ b/llvm/unittests/tools/llvm-cfi-verify/FileAnalysis.cpp
@@ -95,7 +95,7 @@ class BasicAArch64FileAnalysisTest : public BasicFileAnalysisTest {
 
 TEST_F(BasicX86FileAnalysisTest, BasicDisassemblyTraversalTest) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90,                   // 0: nop
@@ -205,7 +205,7 @@ TEST_F(BasicX86FileAnalysisTest, BasicDisassemblyTraversalTest) {
 
 TEST_F(BasicX86FileAnalysisTest, PrevAndNextFromBadInst) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90, // 0: nop
@@ -228,7 +228,7 @@ TEST_F(BasicX86FileAnalysisTest, PrevAndNextFromBadInst) {
 
 TEST_F(BasicX86FileAnalysisTest, CFITrapTest) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90,                   // 0: nop
@@ -263,7 +263,7 @@ TEST_F(BasicX86FileAnalysisTest, CFITrapTest) {
 
 TEST_F(BasicX86FileAnalysisTest, FallThroughTest) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90,                         // 0: nop
@@ -303,7 +303,7 @@ TEST_F(BasicX86FileAnalysisTest, FallThroughTest) {
 
 TEST_F(BasicX86FileAnalysisTest, DefiniteNextInstructionTest) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90,                         // 0: nop
@@ -393,7 +393,7 @@ TEST_F(BasicX86FileAnalysisTest, DefiniteNextInstructionTest) {
 
 TEST_F(BasicX86FileAnalysisTest, ControlFlowXRefsTest) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90,                         // 0: nop
@@ -498,7 +498,7 @@ TEST_F(BasicX86FileAnalysisTest, ControlFlowXRefsTest) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionInvalidTargets) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90,       // 0: nop
@@ -523,7 +523,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionInvalidTargets) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionBasicFallthroughToUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02, // 0: jne 4 [+2]
@@ -539,7 +539,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionBasicFallthroughToUd2) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionBasicJumpToUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02, // 0: jne 4 [+2]
@@ -555,7 +555,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionBasicJumpToUd2) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualPathUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x03, // 0: jne 5 [+3]
@@ -574,7 +574,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualPathUd2) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualPathSingleUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x05, // 0: jne 7 [+5]
@@ -592,7 +592,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualPathSingleUd2) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualFailLimitUpwards) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x06, // 0: jne 8 [+6]
@@ -618,7 +618,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualFailLimitUpwards) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualFailLimitDownwards) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02, // 0: jne 4 [+2]
@@ -643,7 +643,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionDualFailLimitDownwards) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionGoodAndBadPaths) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0xeb, 0x02, // 0: jmp 4 [+2]
@@ -660,7 +660,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionGoodAndBadPaths) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionWithUnconditionalJumpInFallthrough) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x04, // 0: jne 6 [+4]
@@ -677,7 +677,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionWithUnconditionalJumpInFallthrough
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionComplexExample) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   // See unittests/GraphBuilder.cpp::BuildFlowGraphComplexExample for this
   // graph.
   Analysis.parseSectionContents(
@@ -766,7 +766,7 @@ TEST_F(BasicX86FileAnalysisTest, UndefSearchLengthOneTestFarAway) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathExplicit) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02,                         // 0: jne 4 [+2]
@@ -783,7 +783,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathExplicit) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathExplicit2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02,             // 0: jne 4 [+2]
@@ -800,7 +800,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathExplicit2) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathImplicit) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02,                   // 0: jne 4 [+2]
@@ -817,7 +817,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberSinglePathImplicit) {
 
 TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberDualPathImplicit) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x04, // 0: jne 6 [+4]
@@ -836,7 +836,7 @@ TEST_F(BasicX86FileAnalysisTest, CFIProtectionClobberDualPathImplicit) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64BasicUnprotected) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x00, 0x01, 0x3f, 0xd6, // 0: blr x8
@@ -850,7 +850,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64BasicUnprotected) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64BasicProtected) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -866,7 +866,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64BasicProtected) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberBasic) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -883,7 +883,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberBasic) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberOneLoad) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -900,7 +900,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberOneLoad) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddGood) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -918,7 +918,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddGood) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddBad) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -936,7 +936,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddBad) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddBad2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -954,7 +954,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberLoadAddBad2) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberTwoLoads) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -972,7 +972,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberTwoLoads) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberUnrelatedSecondLoad) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -990,7 +990,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberUnrelatedSecondLoad) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberUnrelatedLoads) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x49, 0x00, 0x00, 0x54, // 0: b.ls 8
@@ -1008,7 +1008,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64ClobberUnrelatedLoads) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64GoodAndBadPaths) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x03, 0x00, 0x00, 0x14, // 0: b 12
@@ -1025,7 +1025,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64GoodAndBadPaths) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPaths) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0xc9, 0x00, 0x00, 0x54, // 0: b.ls 24
@@ -1045,7 +1045,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPaths) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPathsBadLoad1) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0xe9, 0x00, 0x00, 0x54, // 0: b.ls 28
@@ -1066,7 +1066,7 @@ TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPathsBadLoad1) {
 
 TEST_F(BasicAArch64FileAnalysisTest, AArch64TwoPathsBadLoad2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0xe9, 0x00, 0x00, 0x54, // 0: b.ls 28

diff  --git a/llvm/unittests/tools/llvm-cfi-verify/GraphBuilder.cpp b/llvm/unittests/tools/llvm-cfi-verify/GraphBuilder.cpp
index 73ba24318203e..6fb500149e386 100644
--- a/llvm/unittests/tools/llvm-cfi-verify/GraphBuilder.cpp
+++ b/llvm/unittests/tools/llvm-cfi-verify/GraphBuilder.cpp
@@ -150,7 +150,7 @@ MATCHER_P2(HasPath, Result, Matcher, "has path " + PrintToString(Matcher)) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestSinglePathFallthroughUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02, // 0: jne 4 [+2]
@@ -177,7 +177,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestSinglePathFallthroughUd2) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestSinglePathJumpUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02, // 0: jne 4 [+2]
@@ -204,7 +204,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestSinglePathJumpUd2) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestDualPathDualUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x03, // 0: jne 5 [+3]
@@ -244,7 +244,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestDualPathDualUd2) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestDualPathSingleUd2) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x05, // 0: jne 7 [+5]
@@ -283,7 +283,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphTestDualPathSingleUd2) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphFailures) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x90,       // 0: nop
@@ -306,7 +306,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphFailures) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphNoXrefs) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0xeb, 0xfe, // 0: jmp 0 [-2]
@@ -322,7 +322,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphNoXrefs) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphConditionalInfiniteLoop) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0xfe, // 0: jne 0 [-2]
@@ -345,7 +345,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphConditionalInfiniteLoop) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphUnconditionalInfiniteLoop) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02, // 0: jne 4 [+2]
@@ -370,7 +370,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphUnconditionalInfiniteLoop) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphNoFlowsToIndirection) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x00, // 0: jne 2 [+0]
@@ -386,7 +386,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphNoFlowsToIndirection) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphLengthExceededUpwards) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x06, // 0: jne 8 [+6]
@@ -416,7 +416,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphLengthExceededUpwards) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphLengthExceededDownwards) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x02, // 0: jne 4 [+2]
@@ -453,7 +453,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphLengthExceededDownwards) {
 // should only need to be generated once.
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphWithRepeatedWork) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   Analysis.parseSectionContents(
       {
           0x75, 0x05, // 0: jne 7 [+5]
@@ -494,7 +494,7 @@ TEST_F(BasicGraphBuilderTest, BuildFlowGraphWithRepeatedWork) {
 
 TEST_F(BasicGraphBuilderTest, BuildFlowGraphComplexExample) {
   if (!SuccessfullyInitialised)
-    return;
+    GTEST_SKIP();
   // The following code has this graph:
   //  +----------+      +--------------+
   //  |    20    | <--- |      0       |


        


More information about the llvm-commits mailing list