// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: cp "%s" "%t/ctu-on-demand-parsing.c"
// RUN: cp "%S/Inputs/ctu-other.c" "%t/ctu-other.c"
//
// Path substitutions on Windows platform could contain backslashes. These are escaped in the json file.
// compile_commands.json is only needed for extdef_mapping, not for the analysis itself.
// RUN: echo '[{"directory":"%t","command":"gcc -std=c89 -Wno-visibility ctu-other.c","file":"ctu-other.c"}]' | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
//
// RUN: echo '"%t/ctu-other.c": ["gcc", "-std=c89", "-Wno-visibility", "ctu-other.c"]' | sed -e 's/\\/\\\\/g' > %t/invocations.yaml
//
// RUN: cd "%t" && %clang_extdef_map "%t/ctu-other.c" > externalDefMap.txt
//
// RUN: cd "%t" && %clang_cc1 -fsyntax-only -std=c89 -analyze \
// RUN: -analyzer-checker=core,debug.ExprInspection \
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
// RUN: -analyzer-config ctu-dir=. \
// RUN: -analyzer-config ctu-invocation-list=invocations.yaml \
// RUN: -analyzer-config ctu-phase1-inlining=all \
// RUN: -verify ctu-on-demand-parsing.c
//
// FIXME: On-demand ctu should be tested in the same file that we have for the
// PCH version, but with a different verify prefix (e.g. -verfiy=on-demand-ctu)
//
// FIXME: Path handling should work on all platforms.
// REQUIRES: system-linux
void ;
// Test typedef and global variable in function.
typedef struct FooBar;
extern FooBar fb;
int ;
void
// Test enums.
int ;
;
void
// Test that asm import does not fail.
int ;
int
// Test reporting error in a macro.
;
int ;
void
// The external function prototype is incomplete.
// warning:implicit functions are prohibited by c99
void
// Tests the import of functions that have a struct parameter
// defined in its prototype.
;
int ;
void