minix/external/bsd/llvm/dist/clang/test/Modules/submodules-preprocess.cpp
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

61 lines
1.6 KiB
C++

// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -x objective-c++ -Eonly -fmodules-cache-path=%t -I %S/Inputs/submodules %s -verify
// FIXME: When we have a syntax for modules in C++, use that.
@import std.vector;
#ifndef HAVE_VECTOR
# error HAVE_VECTOR macro is not available (but should be)
#endif
#ifdef HAVE_TYPE_TRAITS
# error HAVE_TYPE_TRAITS_MAP macro is available (but shouldn't be)
#endif
#ifdef HAVE_HASH_MAP
# error HAVE_HASH_MAP macro is available (but shouldn't be)
#endif
@import std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}}
#ifndef HAVE_VECTOR
# error HAVE_VECTOR macro is not available (but should be)
#endif
#ifndef HAVE_TYPE_TRAITS
# error HAVE_TYPE_TRAITS_MAP macro is not available (but should be)
#endif
#ifdef HAVE_HASH_MAP
# error HAVE_HASH_MAP macro is available (but shouldn't be)
#endif
@import std.vector.compare; // expected-error{{no submodule named 'compare' in module 'std.vector'}}
@import std; // import everything in 'std'
#ifndef HAVE_VECTOR
# error HAVE_VECTOR macro is not available (but should be)
#endif
#ifndef HAVE_TYPE_TRAITS
# error HAVE_TYPE_TRAITS_MAP macro is not available (but should be)
#endif
#ifdef HAVE_HASH_MAP
# error HAVE_HASH_MAP macro is available (but shouldn't be)
#endif
@import std.hash_map;
#ifndef HAVE_VECTOR
# error HAVE_VECTOR macro is not available (but should be)
#endif
#ifndef HAVE_TYPE_TRAITS
# error HAVE_TYPE_TRAITS_MAP macro is not available (but should be)
#endif
#ifndef HAVE_HASH_MAP
# error HAVE_HASH_MAP macro is not available (but should be)
#endif