Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Modules / stddef.c
blob5bc0d1e44c8563fc3e254e9fb5b84790bea3da75
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 -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 -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, both of which are
11 // modular headers. Regardless of whether stddef.h joins the StdDef test module
12 // or is in its _Builtin_stddef module, __stddef_size_t.h will be in
13 // _Builtin_stddef.size_t. It's not defined which module will win as the expected
14 // provider of size_t. For the purposes of this test it doesn't matter which header
15 // gets reported, just as long as it isn't other.h or include_again.h.
16 size_t st; // expected-error-re {{missing '#include "{{size_t|__stddef_size_t}}.h"'; 'size_t' must be declared before it is used}}
17 // expected-note@size_t.h:* 0+ {{here}}
18 // expected-note@__stddef_size_t.h:* 0+ {{here}}
20 #include "include_again.h"
21 // Includes <stddef.h> which includes <__stddef_size_t.h> which imports the
22 // _Builtin_stddef.size_t module.
24 size_t st2;
26 #include "size_t.h"
27 // Redeclares size_t, but the type merger should figure it out.
29 size_t st3;