Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / ctu-cxxdefaultinitexpr.cpp
blobe785a76310bbbe5c473dbb359be0b982a811da6b
1 // RUN: rm -rf %t && mkdir %t
2 // RUN: mkdir -p %t/ctudir
3 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \
4 // RUN: -emit-pch -o %t/ctudir/ctu-cxxdefaultinitexpr-import.cpp.ast %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp
5 // RUN: cp %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
6 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -std=c++17 -analyze \
7 // RUN: -analyzer-checker=core \
8 // RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
9 // RUN: -analyzer-config ctu-dir=%t/ctudir \
10 // RUN: -verify %s
12 // Check that importing this code does not cause crash.
13 // expected-no-diagnostics
15 namespace QHashPrivate {
16 template <typename> int b;
17 struct Data;
18 } // namespace QHashPrivate
20 struct QDomNodePrivate {};
21 template <typename = struct QString> struct QMultiHash {
22 QHashPrivate::Data *d = nullptr;
25 struct QDomNamedNodeMapPrivate {
26 QMultiHash<> map;
28 struct QDomElementPrivate : QDomNodePrivate {
29 QDomElementPrivate();
30 void importee();
31 QMultiHash<> *m_attr = nullptr;
33 // --------- common part end ---------
35 void importer(QDomElementPrivate x) { x.importee(); }