blob: 7d218b13593e31b3d527ddb2a5bb26680ec54a75 [file] [log] [blame]
Douglas Gregorecc2c092011-12-01 22:20:10 +00001// RUN: rm -rf %t
Douglas Gregorc13a34b2012-01-03 19:32:59 +00002// RUN: %clang_cc1 -fmodules -x objective-c++ -Eonly -fmodule-cache-path %t -I %S/Inputs/submodules %s -verify
3// FIXME: When we have a syntax for modules in C++, use that.
Douglas Gregorecc2c092011-12-01 22:20:10 +00004
Douglas Gregorc13a34b2012-01-03 19:32:59 +00005@import std.vector;
Douglas Gregorecc2c092011-12-01 22:20:10 +00006
Douglas Gregor13292642011-12-02 15:45:10 +00007#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
Douglas Gregorecc2c092011-12-01 22:20:10 +000018
Douglas Gregorc13a34b2012-01-03 19:32:59 +000019@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
Douglas Gregorecc2c092011-12-01 22:20:10 +000020
Douglas Gregor13292642011-12-02 15:45:10 +000021#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
Douglas Gregorecc2c092011-12-01 22:20:10 +000032
Douglas Gregorc13a34b2012-01-03 19:32:59 +000033@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
Douglas Gregor13292642011-12-02 15:45:10 +000034
Douglas Gregorc13a34b2012-01-03 19:32:59 +000035@import std; // import everything in 'std'
Douglas Gregor13292642011-12-02 15:45:10 +000036
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
Douglas Gregorc13a34b2012-01-03 19:32:59 +000049@import std.hash_map;
Douglas Gregor13292642011-12-02 15:45:10 +000050
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