1 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.AnalysisOrder -analyzer-config c++-allocator-inlining=true,debug.AnalysisOrder:PreStmtCXXNewExpr=true,debug.AnalysisOrder:PostStmtCXXNewExpr=true,debug.AnalysisOrder:PreCall=true,debug.AnalysisOrder:PostCall=true,debug.AnalysisOrder:NewAllocator=true %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-INLINE
2 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.AnalysisOrder -analyzer-config c++-allocator-inlining=false,debug.AnalysisOrder:PreStmtCXXNewExpr=true,debug.AnalysisOrder:PostStmtCXXNewExpr=true,debug.AnalysisOrder:PreCall=true,debug.AnalysisOrder:PostCall=true,debug.AnalysisOrder:NewAllocator=true %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-NO-INLINE
4 #include "Inputs/system-header-simulator-cxx.h"
11 void *operator new(size_t size
) { return std::malloc(size
); }
12 void operator delete(void *ptr
, size_t size
) { std::free(ptr
); }
30 // CHECK-INLINE: PreCall (operator new)
31 // CHECK-INLINE-NEXT: PreCall (std::malloc)
32 // CHECK-INLINE-NEXT: PostCall (std::malloc)
33 // CHECK-INLINE-NEXT: PostCall (operator new)
34 // CHECK-INLINE-NEXT: NewAllocator
35 // CHECK-NO-INLINE: PreCall (S::S)
36 // CHECK-INLINE-NEXT: PreCall (S::S)
37 // CHECK-NEXT: PostCall (S::S)
38 // CHECK-NEXT: PreStmt<CXXNewExpr>
39 // CHECK-NEXT: PostStmt<CXXNewExpr>
41 // CHECK-NEXT: PreCall (foo)
42 // CHECK-NEXT: PostCall (foo)
44 // CHECK-NEXT: PreCall (S::~S)
45 // CHECK-NEXT: PostCall (S::~S)
46 // CHECK-NEXT: PreCall (operator delete)
47 // CHECK-INLINE-NEXT: PreCall (std::free)
48 // CHECK-INLINE-NEXT: PostCall (std::free)
49 // CHECK-NEXT: PostCall (operator delete)
52 void operator delete(void *ptr, size_t size) {
54 // CHECK-NO-INLINE-NEXT: PreCall (std::free)
55 // CHECK-NO-INLINE-NEXT: PostCall (std::free)
58 void *operator new(size_t size) {
59 return std::malloc(size);
60 // CHECK-NO-INLINE-NEXT: PreCall (std::malloc)
61 // CHECK-NO-INLINE-NEXT: PostCall (std::malloc)