From 486754660bb926339aefcf012a3f848592babb8b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 28 Jul 2018 11:06:01 +0000 Subject: Vendor import of clang trunk r338150: https://llvm.org/svn/llvm-project/cfe/trunk@338150 --- test/Analysis/cxxnewexpr-callback-noinline.cpp | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/Analysis/cxxnewexpr-callback-noinline.cpp (limited to 'test/Analysis/cxxnewexpr-callback-noinline.cpp') diff --git a/test/Analysis/cxxnewexpr-callback-noinline.cpp b/test/Analysis/cxxnewexpr-callback-noinline.cpp new file mode 100644 index 0000000000000..87edeac3fd580 --- /dev/null +++ b/test/Analysis/cxxnewexpr-callback-noinline.cpp @@ -0,0 +1,29 @@ +// 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 + +#include "Inputs/system-header-simulator-cxx.h" + +namespace std { + void *malloc(size_t); +} + +void *operator new(size_t size) { return std::malloc(size); } + +struct S { + S() {} +}; + +void foo(); + +void test() { + S *s = new S(); + foo(); +} + +// CHECK: PreCall (S::S) +// CHECK-NEXT: PostCall (S::S) +// CHECK-NEXT: PreStmt +// CHECK-NEXT: PostStmt +// CHECK-NEXT: PreCall (foo) +// CHECK-NEXT: PostCall (foo) +// CHECK-NEXT: PreCall (std::malloc) +// CHECK-NEXT: PostCall (std::malloc) -- cgit v1.2.3