Adding some more CTU list tests. E.g. to check if a construct is unsupported.
We also slightly modify the handling of the return value of the Import
function from ASTImporter.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/Analysis/ctu-main.c | ||
---|---|---|
3–5 ↗ | (On Diff #176149) | Could you please break these lines? // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu %S/Inputs/ctu-other.c \ // RUN: -emit-pch -o %t/ctudir2/ctu-other.c.ast // // RUN: cp %S/Inputs/externalFnMap2.txt %t/ctudir2/externalFnMap.txt // // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -std=c89 -analyze -verify %s // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=debug.ExprInspection \ // RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \ // RUN: -analyzer-config ctu-dir=%t/ctudir2 |
4 ↗ | (On Diff #176149) | This is a question rather than anything else, why do we have both externalFnMap2.txt and externalFnMap.txt? |
Also, maybe it'd be worth making a CTU directory under test/Analysis for CTU related test files.
Hi Gabor,
Please find my comments inline.
lib/CrossTU/CrossTranslationUnit.cpp | ||
---|---|---|
251 ↗ | (On Diff #176149) | Conditionals with a single-line body don't require braces. |
test/Analysis/Inputs/ctu-other.c | ||
1 ↗ | (On Diff #176149) | Please clang-format the new files. |
6 ↗ | (On Diff #176149) | Please use a consistent naming style across the file. There are names starting with capital, having underscores and written like this. |
- Break long RUN lines
- Clang format the test files
- Use consistent naming style
- Remove braces
test/Analysis/Inputs/ctu-other.c | ||
---|---|---|
6 ↗ | (On Diff #176149) | Ok, I renamed the things, I was trying to be consistent with the LLVM style, one exception is the name of variables still start with small case. |
test/Analysis/ctu-main.c | ||
3–5 ↗ | (On Diff #176149) | Ok, good point. |
4 ↗ | (On Diff #176149) | externalFnMap.txt goes for ctu-other.cpp. |
Also, maybe it'd be worth making a CTU directory under test/Analysis for CTU related test files.
It is a good point, but I'd do that in the future once we have even more ctu related test files. Perhaps together with a new check-clang-analysis-ctu build target.
lib/CrossTU/CrossTranslationUnit.cpp | ||
---|---|---|
247 ↗ | (On Diff #176619) | TODO: add a comment that this function never returns with nullptr on success. And consequently CrossTranslationUnitContext::getCrossTUDefinition neither. |
test/Analysis/ctu-main.c | ||
---|---|---|
4 ↗ | (On Diff #176149) | Sounds great! :) |
test/Analysis/ctu-main.c | ||
---|---|---|
4 ↗ | (On Diff #176149) | Ok, I have renamed the ExternalFnMap files. |