1 //===-- ns2.cpp ------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 printf("static m2.cpp func()\n");
17 void test_lookup_at_file_scope()
20 printf("at file scope: func() = %d\n", func()); // eval func(), exp: 2
21 printf("at file scope: func(10) = %d\n", func(10)); // eval func(10), exp: 11
27 printf("A::B::func()\n");
30 void test_lookup_at_nested_ns_scope()
33 printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 4
35 //printf("func(10) = %d\n", func(10)); // eval func(10), exp: 13
36 // NOTE: Under the rules of C++, this test would normally get an error
37 // because A::B::func() hides A::func(), but lldb intentionally
38 // disobeys these rules so that the intended overload can be found
39 // by only removing duplicates if they have the same type.
41 void test_lookup_at_nested_ns_scope_after_using()
43 // BP_nested_ns_scope_after_using
45 printf("at nested ns scope after using: func() = %d\n", func()); // eval func(), exp: 3
56 printf("A::func(int)\n");
59 void A::test_lookup_at_ns_scope()
62 printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 3
63 printf("at nested ns scope: func(10) = %d\n", func(10)); // eval func(10), exp: 13
64 printf("at nested ns scope: foo() = %d\n", foo()); // eval foo(), exp: 42