[NFC][Clang][test] Inclusive language: Remove and rephrase uses of sanity test/check in clang/test

Part of work to use more inclusive terms in clang/llvm.
This commit is contained in:
Zarko Todorovski 2021-11-24 09:52:01 -05:00
parent fb46e64a01
commit c79345fb7b
39 changed files with 56 additions and 56 deletions

View File

@ -141,7 +141,7 @@ void tautologiesOutside(unsigned char a) {
// Wraparound with mixed types. Note that the analyzer assumes
// -fwrapv semantics.
void mixedWraparoundSanityCheck(int a) {
void mixedWraparoundBasicCheck(int a) {
int max = INT_MAX;
int min = INT_MIN;
@ -197,7 +197,7 @@ void mixedSignedness3(unsigned a) {
}
void multiplicativeSanityTest(int x) {
void multiplicativeBasicTest(int x) {
// At one point we were ignoring the *4 completely -- the constraint manager
// would see x < 8 and then declare the assertion to be known false.
if (x*4 < 8)

View File

@ -4,7 +4,7 @@ void clang_analyzer_eval(int);
#define CHECK(expr) if (!(expr)) return; clang_analyzer_eval(expr)
void testPersistentConstraints(int x, int y) {
// Sanity check
// Basic check
CHECK(x); // expected-warning{{TRUE}}
CHECK(x & 1); // expected-warning{{TRUE}}

View File

@ -18,7 +18,7 @@ typedef typeof(sizeof(int)) size_t;
void PR12206(int x) {
size_t comparisonSize = sizeof(1 == 1);
// Sanity check. This test is useless if size_t isn't bigger than bool.
// This test is useless if size_t isn't bigger than bool.
clang_analyzer_eval(sizeof(size_t) > comparisonSize); // expected-warning{{TRUE}}
// Build a SymIntExpr, dependent on x.
@ -75,7 +75,7 @@ size_t strlen(const char *s);
void PR12206_strlen(const char *x) {
size_t comparisonSize = sizeof(1 == 1);
// Sanity check. This test is useless if size_t isn't bigger than bool.
// This test is useless if size_t isn't bigger than bool.
clang_analyzer_eval(sizeof(size_t) > comparisonSize); // expected-warning{{TRUE}}
// Create a value that requires more bits to store than a comparison result.

View File

@ -93,7 +93,7 @@ namespace ConstructorVirtualCalls {
clang_analyzer_eval(obj.get() == 3); // expected-warning{{TRUE}}
// Sanity check for devirtualization.
// Correctness check for devirtualization.
A *base = &obj;
clang_analyzer_eval(base->get() == 3); // expected-warning{{TRUE}}
}

View File

@ -353,7 +353,7 @@ namespace Redeclaration {
void test(Derived d) {
d.foo(); // don't crash
d.bar(); // sanity check
d.bar(); // basic correctness check
Base &b = d;
b.foo(); // don't crash

View File

@ -214,7 +214,7 @@ namespace DestructorVirtualCalls {
C obj;
clang_analyzer_eval(obj.get() == 3); // expected-warning{{TRUE}}
// Sanity check for devirtualization.
// Correctness check for devirtualization.
A *base = &obj;
clang_analyzer_eval(base->get() == 3); // expected-warning{{TRUE}}

View File

@ -5,7 +5,7 @@
void clang_analyzer_denote(int x, const char *str);
void clang_analyzer_express(int x);
// Invalid declarations to test sanity checks.
// Invalid declarations to test basic correctness checks.
void clang_analyzer_denote();
void clang_analyzer_denote(int x);
void clang_analyzer_express();

View File

@ -11,7 +11,7 @@ struct A {};
struct B {};
void foo(unsigned int unsignedInt, unsigned int readSize) {
// Sanity check the checker is working as expected.
// Verify the checker is working as expected.
A* a = static_cast<A*>(malloc(sizeof(int))); // expected-warning {{Result of 'malloc' is converted to a pointer of type 'struct A', which is incompatible with sizeof operand type 'int'}}
free(a);
}

View File

@ -1,5 +1,5 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
// (sanity check)
// (basic correctness check)
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir

View File

@ -24,14 +24,14 @@ char t1 () {
return '0';
}
// just a sanity test, the same behavior as t1()
// just a basic correctness test, the same behavior as t1()
char t2 () {
*ptr() = 'c';
return '0';
}
// Each of the tests below is repeated with pointers as well as references.
// This is mostly a sanity check, but then again, both should work!
// This is mostly a basic correctness check, but then again, both should work!
char t3 () {
char& r = ref();
r = 'c'; // no-warning

View File

@ -2271,7 +2271,7 @@ void useAfterAutorelease() {
}
void useAfterRelease() {
// Sanity check that the previous example would have warned with CFRelease.
// Verify that the previous example would have warned with CFRelease.
extern CFTypeRef CFCreateSomething();
CFTypeRef obj = CFCreateSomething();
CFRelease(obj);

View File

@ -19,7 +19,7 @@ void t2()
// CHECK-NOT: dbg
// CHECK: }
// For sanity, check those things do occur normally.
// Verify those things do occur normally.
// CHECK-LABEL: @t2
// CHECK: call{{.*}}llvm.dbg
// CHECK: !dbg

View File

@ -4,8 +4,8 @@ id makeObject1() __attribute__((ns_returns_retained));
id makeObject2() __attribute__((ns_returns_retained));
void releaseObject(__attribute__((ns_consumed)) id);
// CHECK-LABEL: define{{.*}} void @_Z10sanityTestv
void sanityTest() {
// CHECK-LABEL: define{{.*}} void @_Z20basicCorrectnessTestv
void basicCorrectnessTest() {
// CHECK: [[X:%.*]] = alloca i8*, align 8
// CHECK-NEXT: [[OBJ1:%.*]] = call i8* @_Z11makeObject1v()
// CHECK-NEXT: store i8* [[OBJ1]], i8** [[X]], align 8
@ -26,7 +26,7 @@ template <typename T>
T makeObjectT2() __attribute__((ns_returns_retained));
template <typename T>
void releaseObjectT(__attribute__((ns_consumed)) T);
void releaseObjectT(__attribute__((ns_consumed)) T);
// CHECK-LABEL: define{{.*}} void @_Z12templateTestv
void templateTest() {

View File

@ -293,7 +293,7 @@ id Test39::bar() { return 0; }
// CHECK-NEXT: ret i8*
// rdar://13617051
// Just a basic sanity-check that IR-gen still works after instantiating
// Just a basic correctness check that IR-gen still works after instantiating
// a non-dependent message send that requires writeback.
@interface Test40
+ (void) foo:(id *)errorPtr;

View File

@ -6,7 +6,7 @@
/// Note that the cortex-a8 is armv7-a, the cortex-a32 is armv8-a
/// and clang's default Arm architecture is armv4t.
/// Sanity check how the options behave when passed to the compiler
/// Basic correctness check for how the options behave when passed to the compiler
// RUN: %clang -target arm-linux-gnueabi -### -c -march=armv7-a %s 2>&1 | \
// RUN: FileCheck --check-prefix=TRIPLE-ARMV7 %s
// RUN: %clang -target arm-linux-gnueabi -### -c -march=armv7-a+crc %s 2>&1 | \

View File

@ -10,7 +10,7 @@
// RUN: %clang -### -S %s -g -target x86_64-pc-freebsd10.0 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WITH-G-DWARF2 %s
// 'g0' is the default. Just sanity-test that it does nothing
// 'g0' is the default. Just basic correctness check that it does nothing
// RUN: %clang -### -S %s -g0 2>&1 | FileCheck --check-prefix=CHECK-WITHOUT-G %s
// And check that the last of -g or -g0 wins.

View File

@ -5,8 +5,8 @@
// RUN: ln -s %S/Inputs/NameInDirInferred.framework %t/NameInImportInferred.framework
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.mcp -fimplicit-module-maps -I %S/Inputs -F %S/Inputs -F %t -Wauto-import -verify %s
// Sanity check that we won't somehow find non-canonical module names or
// modules where we shouldn't search the framework.
// Verify that we won't somehow find non-canonical module names or modules where
// we shouldn't search the framework.
// RUN: echo '@import NameInModMap;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Wauto-import -x objective-c - 2>&1 | FileCheck %s
// RUN: echo '@import NameInDir;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Wauto-import -x objective-c - 2>&1 | FileCheck %s
// RUN: echo '@import NameInImport;' | not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -F %S/Inputs -F %t -Wauto-import -x objective-c - 2>&1 | FileCheck %s

View File

@ -5,8 +5,8 @@
// RUN: rm -rf %t
// Sanity check one of the compilations.
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s -verify -DSANITY_CHECK
// Basic check on one of the compilations.
// RUN: %clang_cc1 -triple aarch64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s -verify -DBASIC_CHECK
// expected-no-diagnostics
// Check all the targets:
@ -23,7 +23,7 @@
// RUN: not %clang_cc1 -triple riscv64-unknown-unknown -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I %S/Inputs -fsyntax-only %s 2> %t.riscv64
// RUN: FileCheck %s -check-prefix=RISCV64 < %t.riscv64
#ifndef SANITY_CHECK
#ifndef BASIC_CHECK
@import TargetFeatures;
// AARCH32-NOT: module 'TargetFeatures' requires
// AARCH64-NOT: module 'TargetFeatures' requires
@ -55,7 +55,7 @@
// RISCV32: module 'TargetFeatures.arm.aarch64' requires feature
// RISCV64: module 'TargetFeatures.arm.aarch64' requires feature
#ifndef SANITY_CHECK
#ifndef BASIC_CHECK
@import TargetFeatures.x86;
// AARCH32: module 'TargetFeatures.x86' requires feature 'x86'
// AARCH64: module 'TargetFeatures.x86' requires feature 'x86'

View File

@ -4,7 +4,7 @@
// RUN: -fmodules-ignore-macro=PREFIX -DPREFIX -I %S/Inputs/va_list \
// RUN: -x objective-c-header %s -o %t.pch -emit-pch
// Include the pch, as a sanity check.
// Include the pch, as a basic correctness check.
// RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
// RUN: -fmodules-ignore-macro=PREFIX -I %S/Inputs/va_list -include-pch %t.pch \
// RUN: -x objective-c %s -fsyntax-only

View File

@ -1,4 +1,4 @@
// Sanity check.
// Basic correctness check.
// RUN: %clang_cc1 -include %S/Inputs/cxx11-statement-attributes.h -std=c++11 -Wimplicit-fallthrough -fsyntax-only %s -o - -verify
// RUN: %clang_cc1 -include %S/Inputs/cxx11-statement-attributes.h -std=c++1z -Wimplicit-fallthrough -fsyntax-only %s -o - -verify
// Run the same tests, this time with the attributes loaded from the PCH file.

View File

@ -37,7 +37,7 @@ void *sel_registerName(const char *);
- (void)methodOnSubclass2;
@end
// Sanity check: the basic initialization pattern.
// Check the basic initialization pattern.
void test_instancetype_alloc_init_simple() {
Root *r1 = [[Root alloc] init];
Subclass1 *sc1 = [[Subclass1 alloc] init];

View File

@ -20,12 +20,12 @@ typedef void (^CoreDAVCompletionBlock)(void);
- (void)M {
I* ace;
self.c = ^() {
// sanity test for the changes.
// Basic correctness check for the changes.
[ace ARR];
for (I *privilege in [ace ARR]) { }
};
self.c = ^() {
// sanity test for the changes.
// Basic correctness test for the changes.
[ace ARR];
};
}

View File

@ -73,7 +73,7 @@ void functionScope() {
//===----------------------------------------------------------------------===//
// Export function declaration. Check different placements.
__attribute__((dllexport)) void decl1A(); // Sanity check with __attribute__
__attribute__((dllexport)) void decl1A(); // Basic check with __attribute__
__declspec(dllexport) void decl1B();
void __attribute__((dllexport)) decl2A();

View File

@ -149,7 +149,7 @@ void functionScope() {
//===----------------------------------------------------------------------===//
// Import function declaration. Check different placements.
__attribute__((dllimport)) void decl1A(); // Sanity check with __attribute__
__attribute__((dllimport)) void decl1A(); // Basic check with __attribute__
__declspec(dllimport) void decl1B();
void __attribute__((dllimport)) decl2A();

View File

@ -12,7 +12,7 @@ void a() {
__func__[0] = 'a'; // expected-error {{variable is not assignable}}
}
// rdar://6097892 - GCC permits this insanity.
// rdar://6097892 - GCC permits this.
const char *b = __func__; // expected-warning {{predefined identifier is only valid}}
const char *c = __FUNCTION__; // expected-warning {{predefined identifier is only valid}}
const char *d = __PRETTY_FUNCTION__; // expected-warning {{predefined identifier is only valid}}

View File

@ -1119,7 +1119,7 @@ struct TestType {
static_assert(!TC.MatchesArgs<TestType *>, "");
}
CoroMemberTag test_sanity(int *) const {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
@ -1211,7 +1211,7 @@ template CoroMemberTag TestType::test_static_template<void>(const char *volatile
template <class... Args>
struct DepTestType {
CoroMemberTag test_sanity(int *) const {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
static_assert(TC.template MatchesArgs<const DepTestType &>, ""); // expected-error {{static_assert failed}}
static_assert(TC.template MatchesArgs<>, ""); // expected-error {{static_assert failed}}

View File

@ -1111,7 +1111,7 @@ struct TestType {
static_assert(!TC.MatchesArgs<TestType *>, "");
}
CoroMemberTag test_sanity(int *) const {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
@ -1203,7 +1203,7 @@ template CoroMemberTag TestType::test_static_template<void>(const char *volatile
template <class... Args>
struct DepTestType {
CoroMemberTag test_sanity(int *) const {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
static_assert(TC.template MatchesArgs<const DepTestType &>, ""); // expected-error {{static_assert failed}}
static_assert(TC.template MatchesArgs<>, ""); // expected-error {{static_assert failed}}

View File

@ -181,7 +181,7 @@ template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Def_Exported> = 1;
//===----------------------------------------------------------------------===//
// Export function declaration. Check different placements.
__attribute__((dllexport)) void decl1A(); // Sanity check with __attribute__
__attribute__((dllexport)) void decl1A(); // Correctness check with __attribute__
__declspec(dllexport) void decl1B();
void __attribute__((dllexport)) decl2A();

View File

@ -267,7 +267,7 @@ template<> __declspec(dllimport) int VarTmpl<ExplicitSpec_Def_Imported> = 1; //
//===----------------------------------------------------------------------===//
// Import function declaration. Check different placements.
__attribute__((dllimport)) void decl1A(); // Sanity check with __attribute__
__attribute__((dllimport)) void decl1A(); // Validation check with __attribute__
__declspec(dllimport) void decl1B();
void __attribute__((dllimport)) decl2A();

View File

@ -2552,7 +2552,7 @@ void test2(Bar* b1, Bar* b2) {
}
// Sanity check -- lock the mutex directly, but use attributes that call getMu()
// Lock the mutex directly, but use attributes that call getMu()
// Also lock the mutex using getFooMu, which calls a lock_returned function.
void test3(Bar* b1, Bar* b2) {
b1->mu_.Lock();
@ -4830,7 +4830,7 @@ class Cell {
// This mainly duplicates earlier tests, but just to make sure...
class PtGuardedBySanityTest {
class PtGuardedByCorrectnessTest {
Mutex mu1;
Mutex mu2;
int* a GUARDED_BY(mu1) PT_GUARDED_BY(mu2);

View File

@ -19,7 +19,7 @@ extern id get();
extern bool condition();
#define nil ((id)0)
void sanity(Test *a) {
void basicCorrectnessTest(Test *a) {
use(a.weakProp); // expected-warning{{weak property 'weakProp' is accessed multiple times in this function but may be unpredictably set to nil; assign to a strong variable to keep the object alive}}
use(a.weakProp); // expected-note{{also accessed here}}
@ -295,7 +295,7 @@ void doWhileLoop(Test *a) {
@end
@implementation Test (Methods)
- (void)sanity {
- (void)basicCorrectnessTest {
use(self.weakProp); // expected-warning{{weak property 'weakProp' is accessed multiple times in this method but may be unpredictably set to nil; assign to a strong variable to keep the object alive}}
use(self.weakProp); // expected-note{{also accessed here}}
}

View File

@ -10,7 +10,7 @@ void radar14415662(RDar14415662 *f, char x, int y) {
f.otherStuff = !f.stuff; // no-warning
BOOL b = !f.stuff; // no-warning
// True positive to sanity check warning is working.
// True positive to verify warning is working.
x = y; // expected-warning {{implicit conversion loses integer precision: 'int' to 'char'}}
}

View File

@ -36,7 +36,7 @@
- (void)methodOnSubclass2;
@end
// Sanity check: the basic initialization pattern.
// Check the basic initialization pattern.
void test_instancetype_alloc_init_simple() {
Root *r1 = [[Root alloc] init];
Subclass1 *sc1 = [[Subclass1 alloc] init];

View File

@ -119,7 +119,7 @@ void doSomething(unsigned v);
}];
}
- (void) test_positive {
// Sanity check that we are really whitelisting 'addOperationWithBlock:' and not doing
// Check that we are really allowlisting 'addOperationWithBlock:' and not doing
// something funny.
[myOperationQueue addSomethingElse:^() { // expected-note {{block will be retained by an object strongly retained by the captured object}}
if (count > 20) {

View File

@ -36,7 +36,7 @@
- (void)methodOnSubclass2;
@end
// Sanity check: the basic initialization pattern.
// Verify the basic initialization pattern.
void test_instancetype_alloc_init_simple() {
Root *r1 = [[Root alloc] init];
Subclass1 *sc1 = [[Subclass1 alloc] init];

View File

@ -268,7 +268,7 @@ class TestImportBase
if (!ToImport)
return testing::AssertionFailure() << "Node type mismatch!";
// Sanity check: the node being imported should match in the same way as
// The node being imported should match in the same way as
// the result node.
internal::BindableMatcher<NodeType> WrapperMatcher(VerificationMatcher);
EXPECT_TRUE(Verifier.match(ToImport, WrapperMatcher));

View File

@ -33,7 +33,7 @@ TEST(CFGDominatorTree, DomTree) {
CFG *cfg = Result.getCFG();
// Sanity checks.
// Basic correctness checks.
EXPECT_EQ(cfg->size(), 4u);
CFGBlock *ExitBlock = *cfg->begin();
@ -122,7 +122,7 @@ TEST(CFGDominatorTree, ControlDependency) {
CFG *cfg = Result.getCFG();
// Sanity checks.
// Basic correctness checks.
EXPECT_EQ(cfg->size(), 6u);
CFGBlock *ExitBlock = *cfg->begin();

View File

@ -220,7 +220,7 @@ public:
};
// Make sure that the DiagnosticWatcher is not miscounting.
TEST(ExternalSemaSource, SanityCheck) {
TEST(ExternalSemaSource, DiagCheck) {
auto Installer = std::make_unique<ExternalSemaSourceInstaller>();
DiagnosticWatcher Watcher("AAB", "BBB");
Installer->PushWatcher(&Watcher);

View File

@ -633,7 +633,7 @@ TEST_F(TokenBufferTest, SpelledByExpanded) {
a1 a2 a3 b1 b2
)cpp");
// Sanity check: expanded and spelled tokens are stored separately.
// Expanded and spelled tokens are stored separately.
EXPECT_THAT(findExpanded("a1 a2"), Not(SameRange(findSpelled("a1 a2"))));
// Searching for subranges of expanded tokens should give the corresponding
// spelled ones.
@ -751,7 +751,7 @@ TEST_F(TokenBufferTest, ExpandedTokensForRange) {
SourceRange R(findExpanded("C").front().location(),
findExpanded("F_washere").front().location());
// Sanity check: expanded and spelled tokens are stored separately.
// Expanded and spelled tokens are stored separately.
EXPECT_THAT(Buffer.expandedTokens(R),
SameRange(findExpanded("C D_washere E F_washere")));
EXPECT_THAT(Buffer.expandedTokens(SourceRange()), testing::IsEmpty());
@ -935,7 +935,7 @@ TEST_F(TokenBufferTest, ExpandedBySpelled) {
recordTokens(R"cpp(
a1 a2 a3 b1 b2
)cpp");
// Sanity check: expanded and spelled tokens are stored separately.
// Expanded and spelled tokens are stored separately.
EXPECT_THAT(findExpanded("a1 a2"), Not(SameRange(findSpelled("a1 a2"))));
// Searching for subranges of expanded tokens should give the corresponding
// spelled ones.