]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / lang / cpp / namespace / ns.cpp
1 //===-- ns.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
12 int foo()
13 {
14     printf("global foo()\n");
15     return 42;
16 }
17 int func()
18 {
19     printf("global func()\n");
20     return 1;
21 }
22 int func(int a)
23 {
24     printf("global func(int)\n");
25     return a + 1;
26 }
27 void test_lookup_at_global_scope()
28 {
29     // BP_global_scope
30     printf("at global scope: foo() = %d\n", foo()); // eval foo(), exp: 42
31     printf("at global scope: func() = %d\n", func()); // eval func(), exp: 1
32 }