brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 812fa01 Raw
35 lines · cpp
1// RUN: rm -rf %t && mkdir %t2// RUN: mkdir -p %t/ctudir3// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \4// RUN:   -emit-pch -o %t/ctudir/ctu-test-import-failure-import.cpp.ast %S/Inputs/ctu-test-import-failure-import.cpp5// RUN: cp %S/Inputs/ctu-test-import-failure-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt6// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \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 %s11 12// Check that importing this code does not cause crash.13// Import intentionally fails because mismatch of '__get_first_arg'.14 15namespace std {16inline namespace __cxx11 {}17template <typename _CharT, typename> class basic_istream;18struct __get_first_arg;19inline namespace __cxx11 {20template <typename, typename, typename> class basic_string;21}22template <typename _CharT, typename _Traits, typename _Alloc>23basic_istream<_CharT, _Traits> &getline(basic_istream<_CharT, _Traits> &,24                                        basic_string<_CharT, _Traits, _Alloc> &,25                                        _CharT) {}26} // namespace std27namespace CommandLine {28extern const int RootExamples[];29}30 31// expected-warning@Inputs/ctu-test-import-failure-import.cpp:14{{incompatible definitions}}32// expected-warning@Inputs/ctu-test-import-failure-import.cpp:14{{incompatible definitions}}33// expected-note@Inputs/ctu-test-import-failure-import.cpp:14{{no corresponding field here}}34// expected-note@Inputs/ctu-test-import-failure-import.cpp:14{{no corresponding field here}}35