xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/submodules-preprocess.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: rm -rf %t
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fmodules -x objective-c++ -Eonly -fmodules-cache-path=%t -I %S/Inputs/submodules %s -verify
3*f4a2713aSLionel Sambuc // FIXME: When we have a syntax for modules in C++, use that.
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc @import std.vector;
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc #ifndef HAVE_VECTOR
8*f4a2713aSLionel Sambuc #  error HAVE_VECTOR macro is not available (but should be)
9*f4a2713aSLionel Sambuc #endif
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc #ifdef HAVE_TYPE_TRAITS
12*f4a2713aSLionel Sambuc #  error HAVE_TYPE_TRAITS_MAP macro is available (but shouldn't be)
13*f4a2713aSLionel Sambuc #endif
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc #ifdef HAVE_HASH_MAP
16*f4a2713aSLionel Sambuc #  error HAVE_HASH_MAP macro is available (but shouldn't be)
17*f4a2713aSLionel Sambuc #endif
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc @import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc #ifndef HAVE_VECTOR
22*f4a2713aSLionel Sambuc #  error HAVE_VECTOR macro is not available (but should be)
23*f4a2713aSLionel Sambuc #endif
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc #ifndef HAVE_TYPE_TRAITS
26*f4a2713aSLionel Sambuc #  error HAVE_TYPE_TRAITS_MAP macro is not available (but should be)
27*f4a2713aSLionel Sambuc #endif
28*f4a2713aSLionel Sambuc 
29*f4a2713aSLionel Sambuc #ifdef HAVE_HASH_MAP
30*f4a2713aSLionel Sambuc #  error HAVE_HASH_MAP macro is available (but shouldn't be)
31*f4a2713aSLionel Sambuc #endif
32*f4a2713aSLionel Sambuc 
33*f4a2713aSLionel Sambuc @import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
34*f4a2713aSLionel Sambuc 
35*f4a2713aSLionel Sambuc @import std; // import everything in 'std'
36*f4a2713aSLionel Sambuc 
37*f4a2713aSLionel Sambuc #ifndef HAVE_VECTOR
38*f4a2713aSLionel Sambuc #  error HAVE_VECTOR macro is not available (but should be)
39*f4a2713aSLionel Sambuc #endif
40*f4a2713aSLionel Sambuc 
41*f4a2713aSLionel Sambuc #ifndef HAVE_TYPE_TRAITS
42*f4a2713aSLionel Sambuc #  error HAVE_TYPE_TRAITS_MAP macro is not available (but should be)
43*f4a2713aSLionel Sambuc #endif
44*f4a2713aSLionel Sambuc 
45*f4a2713aSLionel Sambuc #ifdef HAVE_HASH_MAP
46*f4a2713aSLionel Sambuc #  error HAVE_HASH_MAP macro is available (but shouldn't be)
47*f4a2713aSLionel Sambuc #endif
48*f4a2713aSLionel Sambuc 
49*f4a2713aSLionel Sambuc @import std.hash_map;
50*f4a2713aSLionel Sambuc 
51*f4a2713aSLionel Sambuc #ifndef HAVE_VECTOR
52*f4a2713aSLionel Sambuc #  error HAVE_VECTOR macro is not available (but should be)
53*f4a2713aSLionel Sambuc #endif
54*f4a2713aSLionel Sambuc 
55*f4a2713aSLionel Sambuc #ifndef HAVE_TYPE_TRAITS
56*f4a2713aSLionel Sambuc #  error HAVE_TYPE_TRAITS_MAP macro is not available (but should be)
57*f4a2713aSLionel Sambuc #endif
58*f4a2713aSLionel Sambuc 
59*f4a2713aSLionel Sambuc #ifndef HAVE_HASH_MAP
60*f4a2713aSLionel Sambuc #  error HAVE_HASH_MAP macro is not available (but should be)
61*f4a2713aSLionel Sambuc #endif
62