| Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s | 
| Douglas Gregor | a908e7f | 2009-02-17 03:23:10 +0000 | [diff] [blame] | 2 |  | 
|  | 3 | // PR3592 | 
|  | 4 | static void* malloc(int); | 
|  | 5 | static void* malloc(int size) { | 
|  | 6 | return ((void*)0); /*do not use heap in this file*/ | 
|  | 7 | } | 
| Douglas Gregor | 222e5e4 | 2009-02-18 22:00:45 +0000 | [diff] [blame] | 8 |  | 
| Richard Trieu | 553b2b2 | 2011-12-15 00:38:15 +0000 | [diff] [blame] | 9 | void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc'}} \ | 
| Douglas Gregor | 1209513 | 2009-02-19 00:03:13 +0000 | [diff] [blame] | 10 | // expected-note{{'calloc' is a builtin with type 'void *}} | 
| Douglas Gregor | 222e5e4 | 2009-02-18 22:00:45 +0000 | [diff] [blame] | 11 |  | 
|  | 12 | void f1(void) { | 
| Douglas Gregor | 893c2c9 | 2009-03-23 17:47:24 +0000 | [diff] [blame] | 13 | calloc(0, 0, 0); | 
| Douglas Gregor | 222e5e4 | 2009-02-18 22:00:45 +0000 | [diff] [blame] | 14 | } | 
| Douglas Gregor | 2074977 | 2009-07-07 17:00:05 +0000 | [diff] [blame] | 15 |  | 
|  | 16 | void f2() { | 
|  | 17 | int index = 1; | 
|  | 18 | } | 
|  | 19 |  | 
|  | 20 | static int index; | 
|  | 21 |  | 
|  | 22 | int f3() { | 
|  | 23 | return index << 2; | 
|  | 24 | } | 
|  | 25 |  | 
| Daniel Dunbar | 8b57697 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 26 | typedef int rindex; |