[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Analysis / symbolcast-floatingpoint.cpp
blob8ea4c9b6c24c150d5bb5aefc6fa1ca71e8d70c43
1 // RUN: %clang_analyze_cc1 -x c++ -analyzer-checker=debug.ExprInspection \
2 // RUN: -analyzer-config support-symbolic-integer-casts=false \
3 // RUN: -verify %s
5 // RUN: %clang_analyze_cc1 -x c++ -analyzer-checker=debug.ExprInspection \
6 // RUN: -analyzer-config support-symbolic-integer-casts=true \
7 // RUN: -verify %s
9 template <typename T>
10 void clang_analyzer_dump(T);
12 void test_no_redundant_floating_point_cast(int n) {
14 double D = n / 30;
15 clang_analyzer_dump(D); // expected-warning{{(double) ((reg_$0<int n>) / 30)}}
17 // There are two cast operations evaluated above:
18 // 1. (n / 30) is cast to a double during the store of `D`.
19 // 2. Then in the next line, in RegionStore::getBinding during the load of `D`.
21 // We should not see in the dump of the SVal any redundant casts like
22 // (double) ((double) $n / 30)