xref: /llvm-project/clang/test/Analysis/diagnostics/false-positive-suppression.c (revision 0dd49a5628bbe01cecf6516017da59ae44863ab3)
1 // RUN: %clang_analyze_cc1 -I %S/Inputs -analyzer-checker=core,unix -verify %s
2 // expected-no-diagnostics
3 
4 #include "include/sys/queue.h"
5 
6 typedef __typeof(sizeof(int)) size_t;
7 void *malloc(size_t);
8 
radar12491259(void)9 int radar12491259(void) {
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 
radar12491259_inside_macro(void)18 int radar12491259_inside_macro(void) {
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 }
24