brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 36a0740 Raw
36 lines · cpp
1// RUN: %clang_cc1 -std=c++1z -fmodules %s -verify2 3#pragma clang module build baz4  module baz {}5#pragma clang module endbuild // baz6 7#pragma clang module build foo8  module foo { module bar {} }9#pragma clang module contents10  #pragma clang module begin foo.bar11  12    // Can import baz here even though it was created in an outer build.13    #pragma clang module import baz14  15    #pragma clang module build bar16      module bar {}17    #pragma clang module contents18      #pragma clang module begin bar19        extern int n;20      #pragma clang module end21    #pragma clang module endbuild // bar22    23    #pragma clang module import bar24    25    constexpr int *f() { return &n; }26  27  #pragma clang module end28#pragma clang module endbuild // foo29 30#pragma clang module import bar31#pragma clang module import foo.bar32static_assert(f() == &n);33 34#pragma clang module build // expected-error {{expected module name}}35#pragma clang module build unterminated // expected-error {{no matching '#pragma clang module endbuild'}}36