[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / stddef.c
blob7623982614681009cf6fefd358916f67f1e2ae0b
1 // RUN: rm -rf %t
2 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fbuiltin-headers-in-system-modules -fmodules-cache-path=%t -I%S/Inputs/StdDef %s -verify=builtin-headers-in-system-modules -fno-modules-error-recovery
3 // RUN: rm -rf %t
4 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/StdDef %s -verify=no-builtin-headers-in-system-modules -fno-modules-error-recovery
6 #include "ptrdiff_t.h"
8 ptrdiff_t pdt;
10 // size_t is declared in both size_t.h and __stddef_size_t.h. If
11 // -fbuiltin-headers-in-system-modules is set, then __stddef_size_t.h is a
12 // non-modular header that will be transitively pulled in the StdDef test module
13 // by include_again.h. Otherwise it will be in the _Builtin_stddef module. In
14 // any case it's not defined which module will win as the expected provider of
15 // size_t. For the purposes of this test it doesn't matter which of the two
16 // providing headers get reported.
17 size_t st; // builtin-headers-in-system-modules-error-re {{missing '#include "{{size_t|include_again}}.h"'; 'size_t' must be declared before it is used}} \
18 no-builtin-headers-in-system-modules-error-re {{missing '#include "{{size_t|__stddef_size_t}}.h"'; 'size_t' must be declared before it is used}}
19 // builtin-headers-in-system-modules-note@size_t.h:* 0+ {{here}} \
20 no-builtin-headers-in-system-modules-note@size_t.h:* 0+ {{here}}
21 // builtin-headers-in-system-modules-note@__stddef_size_t.h:* 0+ {{here}} \
22 no-builtin-headers-in-system-modules-note@__stddef_size_t.h:* 0+ {{here}}
24 #include "include_again.h"
25 // Includes <stddef.h> which includes <__stddef_size_t.h>.
27 size_t st2;
29 #include "size_t.h"
30 // Redeclares size_t when -fbuiltin-headers-in-system-modules is not passed, but
31 // the type merger should figure it out.
33 size_t st3;