blob: 87c04cbcdc0749208b0613ce35a4c4f0a2ce1cf7 [file] [log] [blame]
Dominic Chen184c6242017-03-03 18:02:02 +00001// RUN: %clang_analyze_cc1 -I %S/Inputs -analyzer-checker=core,unix -verify %s
Anna Zaks7d9ce532013-01-19 02:18:15 +00002// expected-no-diagnostics
3
4#include "include/sys/queue.h"
5
6typedef __typeof(sizeof(int)) size_t;
7void *malloc(size_t);
8
9int radar12491259() {
10 int *p = malloc(12);
11 FREE_POINTER(p);
12 FREE_POINTER(p); // no-warning: we are suppressing errors coming from sys/queue macros.
13 return 0;
14}
15
16#define MYMACRO(p) FREE_POINTER(p)
17
18int radar12491259_inside_macro() {
19 int *p = malloc(12);
20 MYMACRO(p);
21 MYMACRO(p); // no-warning: we are suppressing errors coming from sys/queue macros.
22 return 0;
23}