Use NULL instead of nullptr in invalid-pointer-pairs-compare-null.cc; nullptr is not available on older Darwin systems.

llvm-svn: 324136
This commit is contained in:
Kuba Mracek 2018-02-02 20:42:29 +00:00
parent 10aa254ecd
commit f1ddefb55f
1 changed files with 8 additions and 8 deletions

View File

@ -15,28 +15,28 @@ char small_global[7] = {};
int main() {
// Heap allocated memory.
char *p = (char *)malloc(42);
int r = foo(p, nullptr);
int r = foo(p, NULL);
free(p);
p = (char *)malloc(1024);
foo(nullptr, p);
foo(NULL, p);
free(p);
p = (char *)malloc(4096);
foo(p, nullptr);
foo(p, NULL);
free(p);
// Global variable.
foo(&global[0], nullptr);
foo(&global[1000], nullptr);
foo(&global[0], NULL);
foo(&global[1000], NULL);
p = &small_global[0];
foo(p, nullptr);
foo(p, NULL);
// Stack variable.
char stack[10000];
foo(&stack[0], nullptr);
foo(nullptr, &stack[9000]);
foo(&stack[0], NULL);
foo(NULL, &stack[9000]);
return 0;
}