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