Daniel Dunbar | ffd408a | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Douglas Gregor | 4d6b102 | 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 | 6b3cca6 | 2009-02-18 22:00:45 +0000 | [diff] [blame] | 8 | |
| 9 | void *calloc(int, int, int); // expected-warning{{incompatible redeclaration of library function 'calloc' will be ignored}} \ |
Douglas Gregor | 7de04c0 | 2009-02-19 00:03:13 +0000 | [diff] [blame] | 10 | // expected-note{{'calloc' is a builtin with type 'void *}} |
Douglas Gregor | 6b3cca6 | 2009-02-18 22:00:45 +0000 | [diff] [blame] | 11 | |
| 12 | void f1(void) { |
Douglas Gregor | 1e23a5f | 2009-03-23 17:47:24 +0000 | [diff] [blame] | 13 | calloc(0, 0, 0); |
Douglas Gregor | 6b3cca6 | 2009-02-18 22:00:45 +0000 | [diff] [blame] | 14 | } |