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