Summary: Moves lldbsuite tests to lldb/test/API.
This is a largely mechanical change, moved with the following steps:
```
rm lldb/test/API/testcases
mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}
mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner
for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done
```
lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.
Reviewers: labath, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71151
125 lines
2.7 KiB
C++
125 lines
2.7 KiB
C++
//===-- main.cpp ------------------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include <cstdarg>
|
|
#include <cstdlib>
|
|
#include "ns.h"
|
|
|
|
namespace {
|
|
typedef unsigned int my_uint_t;
|
|
int i; // Find the line number for anonymous namespace variable i.
|
|
|
|
int myanonfunc (int a)
|
|
{
|
|
return a + a;
|
|
}
|
|
|
|
int
|
|
variadic_sum (int arg_count...)
|
|
{
|
|
int sum = 0;
|
|
std::va_list args;
|
|
va_start(args, arg_count);
|
|
|
|
for (int i = 0; i < arg_count; i++)
|
|
sum += va_arg(args, int);
|
|
|
|
va_end(args);
|
|
return sum;
|
|
}
|
|
}
|
|
|
|
namespace A {
|
|
typedef unsigned int uint_t;
|
|
namespace B {
|
|
typedef unsigned int uint_t;
|
|
int j; // Find the line number for named namespace variable j.
|
|
int myfunc (int a);
|
|
int myfunc2(int a)
|
|
{
|
|
return a + 2;
|
|
}
|
|
float myfunc (float f)
|
|
{
|
|
return f - 2.0;
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace Y
|
|
{
|
|
typedef unsigned int uint_t;
|
|
using A::B::j;
|
|
int foo;
|
|
}
|
|
|
|
using A::B::j; // using declaration
|
|
|
|
namespace Foo = A::B; // namespace alias
|
|
|
|
using Foo::myfunc; // using declaration
|
|
|
|
using namespace Foo; // using directive
|
|
|
|
namespace A {
|
|
namespace B {
|
|
using namespace Y;
|
|
int k;
|
|
}
|
|
}
|
|
|
|
namespace ns1 {
|
|
int value = 100;
|
|
}
|
|
|
|
namespace ns2 {
|
|
int value = 200;
|
|
}
|
|
|
|
void test_namespace_scopes() {
|
|
do {
|
|
using namespace ns1;
|
|
printf("ns1::value = %d\n", value); // Evaluate ns1::value
|
|
} while(0);
|
|
|
|
do {
|
|
using namespace ns2;
|
|
printf("ns2::value = %d\n", value); // Evaluate ns2::value
|
|
} while(0);
|
|
}
|
|
|
|
int Foo::myfunc(int a)
|
|
{
|
|
test_namespace_scopes();
|
|
|
|
::my_uint_t anon_uint = 0;
|
|
A::uint_t a_uint = 1;
|
|
B::uint_t b_uint = 2;
|
|
Y::uint_t y_uint = 3;
|
|
i = 3;
|
|
j = 4;
|
|
printf("::i=%d\n", ::i);
|
|
printf("A::B::j=%d\n", A::B::j);
|
|
printf("variadic_sum=%d\n", variadic_sum(3, 1, 2, 3));
|
|
myanonfunc(3);
|
|
return myfunc2(3) + j + i + a + 2 + anon_uint + a_uint + b_uint + y_uint; // Set break point at this line.
|
|
}
|
|
|
|
int
|
|
main (int argc, char const *argv[])
|
|
{
|
|
test_lookup_at_global_scope();
|
|
test_lookup_at_file_scope();
|
|
A::test_lookup_at_ns_scope();
|
|
A::B::test_lookup_at_nested_ns_scope();
|
|
A::B::test_lookup_at_nested_ns_scope_after_using();
|
|
test_lookup_before_using_directive();
|
|
test_lookup_after_using_directive();
|
|
return Foo::myfunc(12);
|
|
}
|