mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
f7a38eeccb
Added a new run line to bolster gradual transition of handling cast operations, see https://discourse.llvm.org/t/roadmap-of-modeling-symbolic-cast-operations/63107 Differential Revision: https://reviews.llvm.org/D127649
41 lines
1.5 KiB
C++
41 lines
1.5 KiB
C++
// RUN: %clang_analyze_cc1 -x c++ -analyzer-checker=debug.ExprInspection \
|
|
// RUN: -analyzer-config support-symbolic-integer-casts=false \
|
|
// RUN: -verify %s
|
|
|
|
// RUN: %clang_analyze_cc1 -x c++ -analyzer-checker=debug.ExprInspection \
|
|
// RUN: -analyzer-config support-symbolic-integer-casts=true \
|
|
// RUN: -verify %s
|
|
|
|
// Self-tests for the debug.ExprInspection checker.
|
|
|
|
template <typename T>
|
|
void clang_analyzer_denote(T x, const char *str);
|
|
template <typename T>
|
|
void clang_analyzer_express(T x);
|
|
|
|
// Invalid declarations to test basic correctness checks.
|
|
void clang_analyzer_denote();
|
|
void clang_analyzer_denote(int x);
|
|
void clang_analyzer_express();
|
|
|
|
void foo(int x, unsigned y) {
|
|
clang_analyzer_denote(); // expected-warning{{clang_analyzer_denote() requires a symbol and a string literal}}
|
|
clang_analyzer_express(); // expected-warning{{Missing argument}}
|
|
|
|
clang_analyzer_denote(x); // expected-warning{{clang_analyzer_denote() requires a symbol and a string literal}}
|
|
clang_analyzer_express(x); // expected-warning{{Unable to express}}
|
|
|
|
clang_analyzer_denote(x, "$x");
|
|
clang_analyzer_express(-x); // expected-warning{{-$x}}
|
|
|
|
clang_analyzer_denote(y, "$y");
|
|
clang_analyzer_express(x + y); // expected-warning{{$x + $y}}
|
|
|
|
clang_analyzer_denote(1, "$z"); // expected-warning{{Not a symbol}}
|
|
clang_analyzer_express(1); // expected-warning{{Not a symbol}}
|
|
|
|
clang_analyzer_denote(x + 1, "$w");
|
|
clang_analyzer_express(x + 1); // expected-warning{{$w}}
|
|
clang_analyzer_express(y + 1); // expected-warning{{$y + 1U}}
|
|
}
|