xref: /aosp_15_r20/external/clang/test/Modules/cstd.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: rm -rf %t
2*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -isystem %S/Inputs/System/usr/include -ffreestanding -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -D__need_wint_t -Werror=implicit-function-declaration %s
3*67e74705SXin Li
4*67e74705SXin Li@import uses_other_constants;
5*67e74705SXin Liconst double other_value = DBL_MAX;
6*67e74705SXin Li
7*67e74705SXin Li// Supplied by compiler, but referenced from the "/usr/include" module map.
8*67e74705SXin Li@import cstd.float_constants;
9*67e74705SXin Li
10*67e74705SXin Lifloat getFltMax() { return FLT_MAX; }
11*67e74705SXin Li
12*67e74705SXin Li// Supplied by the "/usr/include" module map.
13*67e74705SXin Li@import cstd.stdio;
14*67e74705SXin Li
15*67e74705SXin Livoid test_fprintf(FILE *file) {
16*67e74705SXin Li  fprintf(file, "Hello, modules\n");
17*67e74705SXin Li}
18*67e74705SXin Li
19*67e74705SXin Li// Supplied by compiler, which forwards to the "/usr/include" version.
20*67e74705SXin Li@import cstd.stdint;
21*67e74705SXin Li
22*67e74705SXin Limy_awesome_nonstandard_integer_type value2;
23*67e74705SXin Li
24*67e74705SXin Li// Supplied by the compiler; that version wins.
25*67e74705SXin Li@import cstd.stdbool;
26*67e74705SXin Li
27*67e74705SXin Li#ifndef bool
28*67e74705SXin Li#  error "bool was not defined!"
29*67e74705SXin Li#endif
30*67e74705SXin Li
31