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