[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / Analysis / end-function-return-stmt.cpp
blob036ccba3aa9329b1aeda7737076fe8c997d74721
1 //RUN: %clang_analyze_cc1 -analyzer-checker=debug.AnalysisOrder -analyzer-config debug.AnalysisOrder:EndFunction=true %s 2>&1 | FileCheck %s
3 // At the end of a function, we can only obtain a ReturnStmt if the last
4 // CFGElement in the CFGBlock is either a CFGStmt or a CFGAutomaticObjDtor.
6 void noReturnStmt() {}
8 struct S {
9 S();
10 ~S();
13 int dtorAfterReturnStmt() {
14 S s;
15 return 0;
18 S endsWithReturnStmt() {
19 return S();
22 // endsWithReturnStmt()
23 // CHECK: EndFunction
24 // CHECK-NEXT: ReturnStmt: yes
25 // CHECK-NEXT: CFGElement: CFGStmt
27 // dtorAfterReturnStmt()
28 // CHECK: EndFunction
29 // CHECK-NEXT: ReturnStmt: yes
30 // CHECK-NEXT: CFGElement: CFGAutomaticObjDtor
32 // noReturnStmt()
33 // CHECK: EndFunction
34 // CHECK-NEXT: ReturnStmt: no