// elementary tests for #import
#define A() 1
////////////////////////////////////////////////////////////////////////////////
#region region_A
#define B() 2
// test, whether global macros are (in)visible here
A() = A()
2 = B()
// import a global name
#import ::A
// test, whether global macros are (in)visible here
1 = A()
2 = B()
// nested region
#region region_B
#define C() 3
#define D() 4
// test, whether global macros are (in)visible here
// test, whether macros from other scopes are (in)visible here
A() = A()
B() = B()
3 = C()
4 = D()
// #import a global name and a name from an outer scope
#import ::A, ::region_A::B
// test, whether global macros are (in)visible here
// test, whether macros from other scopes are (in)visible here
1 = A()
2 = B()
3 = C()
4 = D()
#endregion // region_B
// test, whether macros from other scopes are (in)visible here
C() = C()
D() = D()
// import a name from an inner scope
#import ::region_A::region_B::C
#import region_B::D
3 = C()
4 = D()
#endregion // region_A
// test, whether macros, defined inside a scope are (in)visible here
1 = A()
B() = B()
D() = D()
////////////////////////////////////////////////////////////////////////////////
// the named region is extended here
#region region_A
// test, whether global macros are (in)visible here
#define E() 5
1 = A()
2 = B()
3 = E()
// extend nested region
#region region_B
1 = A()
2 = B()
3 = C()
4 = D()
E() = E()
#import ::region_A::E
1 = A()
2 = B()
3 = C()
4 = D()
5 = E()
#endregion // region_B
#endregion // region_A
// test, whether macros, defined inside a scope are (in)visible here
#if defined(B)
#error "Macro 'B' shouldn't be visible here!"
#endif
1 = A()
B() = B()
C() = C()
D() = D()
E() = E()
// import names from inner scopes to the global scope
#import ::region_A::B, region_A::E
1 = A()
2 = B()
C() = C()
D() = D()
5 = E()