Skip to content

Commit 08201cb

Browse files
committed
[lldb][test] Fix GCC warnings in TestGetControlFlowKindX86.cpp
``` <...>/TestGetControlFlowKindx86.cpp:148:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 148 | if (kind == eInstructionControlFlowKindReturn) | ^ ``` Usually llvm is a "no braces for single line body" project but for whatever reason gcc objects to it here. Perhaps because it's within a for loop. Added the newlines just for readability.
1 parent 576aa3a commit 08201cb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lldb/unittests/Disassembler/x86/TestGetControlFlowKindx86.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,19 @@ TEST_F(TestGetControlFlowKindx86, TestX86_64Instruction) {
145145
EXPECT_EQ(kind, result[i]);
146146

147147
// Also, test the DisassemblerLLVMC::MCDisasmInstance methods.
148-
if (kind == eInstructionControlFlowKindReturn)
148+
if (kind == eInstructionControlFlowKindReturn) {
149149
EXPECT_FALSE(inst_sp->IsCall());
150-
if (kind == eInstructionControlFlowKindCall)
150+
}
151+
152+
if (kind == eInstructionControlFlowKindCall) {
151153
EXPECT_TRUE(inst_sp->IsCall());
154+
}
155+
152156
if (kind == eInstructionControlFlowKindCall ||
153157
kind == eInstructionControlFlowKindJump ||
154158
kind == eInstructionControlFlowKindCondJump ||
155-
kind == eInstructionControlFlowKindReturn)
159+
kind == eInstructionControlFlowKindReturn) {
156160
EXPECT_TRUE(inst_sp->DoesBranch());
161+
}
157162
}
158163
}

0 commit comments

Comments
 (0)