llvm-project/clang/test/Analysis/analyzeOneFunction.cpp
Paul Kirth f5e2c5ddce
[clang][test] Fix test issue under LLVM_REVERSE_ITERATION (#167394)
The order of these items may not be the same if reverse iteration is
enabled. From what I can tell this is related to visitation order, and I
don't see an easy way to handle that using the typical solutions, like
MapVector, etc. For now, just use CHECK-DAG to get the test into a
passing state.

Fixes #167057
2025-11-11 11:29:52 -08:00

19 lines
808 B
C++

// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s \
// RUN: -analyze-function="Window::overloaded(int)"
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s \
// RUN: -analyze-function="c:@S@Window@F@overloaded#I#"
// RUN: %clang_extdef_map %s | FileCheck %s
// CHECK-DAG: 27:c:@S@Window@F@overloaded#I#
// CHECK-DAG: 27:c:@S@Window@F@overloaded#C#
// CHECK-DAG: 27:c:@S@Window@F@overloaded#d#
void clang_analyzer_warnIfReached();
struct Window {
void overloaded(double) { clang_analyzer_warnIfReached(); } // not analyzed, thus not reachable
void overloaded(char) { clang_analyzer_warnIfReached(); } // not analyzed, thus not reachable
void overloaded(int) { clang_analyzer_warnIfReached(); } // expected-warning {{REACHABLE}}
};