blob: 9fb7e62454bdc94fb52fe17d17b8ca05b7a1d194 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregora908e7f2009-02-17 03:23:10 +00002
3// PR3592
4static void* malloc(int);
5static void* malloc(int size) {
6 return ((void*)0); /*do not use heap in this file*/
7}
Douglas Gregor222e5e42009-02-18 22:00:45 +00008
Richard Trieu553b2b22011-12-15 00:38:15 +00009void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc'}} \
Douglas Gregor12095132009-02-19 00:03:13 +000010// expected-note{{'calloc' is a builtin with type 'void *}}
Douglas Gregor222e5e42009-02-18 22:00:45 +000011
12void f1(void) {
Douglas Gregor893c2c92009-03-23 17:47:24 +000013 calloc(0, 0, 0);
Douglas Gregor222e5e42009-02-18 22:00:45 +000014}
Douglas Gregor20749772009-07-07 17:00:05 +000015
16void f2() {
17 int index = 1;
18}
19
20static int index;
21
22int f3() {
23 return index << 2;
24}
25
Daniel Dunbar8b576972009-11-08 01:45:36 +000026typedef int rindex;