42 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir %t3 4// RUN: echo '41:c:@S@G@F@G#@Sa@F@operator void (*)(int)#1 %/t/importee.ast' >> %t/externalDefMap.txt5// RUN: echo '38:c:@S@G@F@G#@Sa@F@operator void (*)()#1 %/t/importee.ast' >> %t/externalDefMap.txt6// RUN: echo '14:c:@F@importee# %/t/importee.ast' >> %t/externalDefMap.txt7// RUN: %clang_cc1 -emit-pch %/S/Inputs/ctu-lookup-name-with-space.cpp -o %t/importee.ast8 9// RUN: cd %t10// RUN: %clang_analyze_cc1 \11// RUN: -analyzer-checker=core \12// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \13// RUN: -analyzer-config ctu-dir=. \14// RUN: -analyzer-config display-ctu-progress=true \15// RUN: -verify %s 2>&1 | FileCheck %s16 17// CHECK: CTU loaded AST file18 19// FIXME: In this test case, we cannot use the on-demand-parsing approach to20// load the external TU.21//22// In the Darwin system, the target triple is determined by the driver,23// rather than using the default one like other systems. However, when24// using bare `clang -cc1`, the adjustment is not done, which cannot25// match the one loaded with on-demand-parsing (adjusted triple).26// We bypass this problem by loading AST files, whose target triple is27// also unadjusted when generated via `clang -cc1 -emit-pch`.28//29// Refer to: https://discourse.llvm.org/t/6076230//31// This is also the reason why the test case of D75665 (introducing32// the on-demand-parsing feature) is enabled only on Linux.33 34void importee();35 36void trigger() {37 // Call an external function to trigger the parsing process of CTU index.38 // Refer to file Inputs/ctu-lookup-name-with-space.cpp for more details.39 40 importee(); // expected-no-diagnostics41}42