forked from GPUOpen-Drivers/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged master:c8f1d442d085 into amd-gfx:f962ee3d4a2c
Local branch amd-gfx f962ee3 Merged master:ce6153a5282c into amd-gfx:1f4ea6f8b241 Remote branch master c8f1d44 split darwin-version-min-load-command.s into Arm64 subtest to avoid failures
- Loading branch information
Showing
195 changed files
with
2,983 additions
and
1,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...ols-extra/test/clang-tidy/checkers/readability-else-after-return-no-cond-var-refactor.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// RUN: %check_clang_tidy %s readability-else-after-return %t -- \ | ||
// RUN: -config='{CheckOptions: [ \ | ||
// RUN: {key: readability-else-after-return.WarnOnConditionVariables, value: false}, \ | ||
// RUN: ]}' | ||
|
||
bool foo(int Y) { | ||
// Excess scopes are here so that the check would have to opportunity to | ||
// refactor the variable out of the condition. | ||
|
||
// Expect warnings here as we don't need to move declaration of 'X' out of the | ||
// if condition as its not used in the else. | ||
{ | ||
if (int X = Y) | ||
return X < 0; | ||
else | ||
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not use 'else' after 'return' | ||
return false; | ||
} | ||
{ | ||
if (int X = Y; X) | ||
return X < 0; | ||
else | ||
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not use 'else' after 'return' | ||
return false; | ||
} | ||
|
||
// Expect no warnings for these cases, as even though its safe to move | ||
// declaration of 'X' out of the if condition, that has been disabled | ||
// by the options. | ||
{ | ||
if (int X = Y) | ||
return false; | ||
else | ||
return X < 0; | ||
} | ||
{ | ||
if (int X = Y; X) | ||
return false; | ||
else | ||
return X < 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.