]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
Vendor import of lldb trunk r338150:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / lang / cpp / namespace / ns3.cpp
1 //===-- ns3.cpp ------------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "ns.h"
11 extern int func();
12
13 // Note: the following function must be before the using.
14 void test_lookup_before_using_directive()
15 {
16   // BP_before_using_directive
17   std::printf("before using directive: func() = %d\n", func()); // eval func(), exp: 1
18 }
19 using namespace A;
20 void test_lookup_after_using_directive()
21 {
22   // BP_after_using_directive
23   //printf("func() = %d\n", func()); // eval func(), exp: error, amiguous
24   std::printf("after using directive: func2() = %d\n", func2()); // eval func2(), exp: 3
25   std::printf("after using directive: ::func() = %d\n", ::func()); // eval ::func(), exp: 1
26   std::printf("after using directive: B::func() = %d\n", B::func()); // eval B::func(), exp: 4
27 }