blob: 4b44bf5b96a0779ac2cadd0140d923c95b5a8dba [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -pedantic -verify %s
Chris Lattnerd28f8152007-08-26 01:10:14 +00002
3int test(char *C) { // nothing here should warn.
4 return C != ((void*)0);
5 return C != (void*)0;
6 return C != 0;
7}
8
Steve Naroff77878cc2007-08-27 04:08:11 +00009int equal(char *a, const char *b)
10{
11 return a == b;
12}
Eli Friedman4e92acf2008-02-06 04:53:22 +000013
14int arrays(char (*a)[5], char(*b)[10], char(*c)[5]) {
15 int d = (a == c);
16 return a == b; // expected-warning {{comparison of distinct pointer types}}
17}