mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
ASan: fix lint
llvm-svn: 173795
This commit is contained in:
@@ -394,19 +394,19 @@ TEST(AddressSanitizer, ReallocTest) {
|
||||
TEST(AddressSanitizer, ZeroSizeMallocTest) {
|
||||
// Test that malloc(0) and similar functions don't return NULL.
|
||||
void *ptr = Ident(malloc(0));
|
||||
EXPECT_FALSE(0 == ptr);
|
||||
EXPECT_TRUE(NULL != ptr);
|
||||
free(ptr);
|
||||
#if !defined(__APPLE__) && !defined(ANDROID) && !defined(__ANDROID__)
|
||||
int pm_res = posix_memalign(&ptr, 1<<20, 0);
|
||||
EXPECT_EQ(0, pm_res);
|
||||
EXPECT_FALSE(0 == ptr);
|
||||
EXPECT_TRUE(NULL != ptr);
|
||||
free(ptr);
|
||||
#endif
|
||||
int *int_ptr = new int [0];
|
||||
int *int_ptr = new int[0];
|
||||
int *int_ptr2 = new int[0];
|
||||
EXPECT_FALSE(0 == int_ptr);
|
||||
EXPECT_FALSE(0 == int_ptr2);
|
||||
EXPECT_FALSE(int_ptr == int_ptr2);
|
||||
EXPECT_TRUE(NULL != int_ptr);
|
||||
EXPECT_TRUE(NULL != int_ptr2);
|
||||
EXPECT_NE(int_ptr, int_ptr2);
|
||||
delete[] int_ptr;
|
||||
delete[] int_ptr2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user