brintos

brintos / llvm-project-archived public Read only

0
0
Text · 431 B · 2be397e Raw
14 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wnull-arithmetic %s2#define NULL __null3 4@interface X5@end6 7void f() {8  bool b;9  X *d;10  b = d < NULL || NULL < d || d > NULL || NULL > d; // expected-error 4{{ordered comparison between pointer and zero}}11  b = d <= NULL || NULL <= d || d >= NULL || NULL >= d; // expected-error 4{{ordered comparison between pointer and zero}}12  b = d == NULL || NULL == d || d != NULL || NULL != d;13}14