mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 16:26:05 +00:00

Summary: This change moves tests for checkers and infrastructure into separate directories, making it easier to find infrastructure tests. Tests for checkers are already easy to find because they are named after the checker. Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers. Now they are in a separate directory. Reviewers: jfb, jdoerfert, lebedev.ri Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68807 llvm-svn: 374540
19 lines
456 B
C++
19 lines
456 B
C++
// REQUIRES: static-analyzer
|
|
// RUN: clang-tidy %s -checks='-*,clang-analyzer-*' -- | FileCheck %s
|
|
extern void *malloc(unsigned long);
|
|
extern void free(void *);
|
|
|
|
void f() {
|
|
int *p = new int(42);
|
|
delete p;
|
|
delete p;
|
|
// CHECK: warning: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete]
|
|
}
|
|
|
|
void g() {
|
|
void *q = malloc(132);
|
|
free(q);
|
|
free(q);
|
|
// CHECK: warning: Attempt to free released memory [clang-analyzer-unix.Malloc]
|
|
}
|