summaryrefslogtreecommitdiffstats
path: root/test/Sema/compare.c
blob: 4b44bf5b96a0779ac2cadd0140d923c95b5a8dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: clang-cc -fsyntax-only -pedantic -verify %s

int test(char *C) { // nothing here should warn.
  return C != ((void*)0);
  return C != (void*)0;
  return C != 0;
}

int equal(char *a, const char *b)
{
    return a == b;
}

int arrays(char (*a)[5], char(*b)[10], char(*c)[5]) {
  int d = (a == c);
  return a == b; // expected-warning {{comparison of distinct pointer types}}
}
OpenPOWER on IntegriCloud