diff options
Diffstat (limited to 'lldb/test/Shell')
-rw-r--r-- | lldb/test/Shell/Driver/LocalLLDBInit.test | 2 | ||||
-rw-r--r-- | lldb/test/Shell/Expr/TestExprLanguageNote.test | 4 | ||||
-rw-r--r-- | lldb/test/Shell/SymbolFile/NativePDB/simple-types.cpp | 127 | ||||
-rwxr-xr-x | lldb/test/Shell/helper/build.py | 8 |
4 files changed, 131 insertions, 10 deletions
diff --git a/lldb/test/Shell/Driver/LocalLLDBInit.test b/lldb/test/Shell/Driver/LocalLLDBInit.test index 5db545e..2aa8c52 100644 --- a/lldb/test/Shell/Driver/LocalLLDBInit.test +++ b/lldb/test/Shell/Driver/LocalLLDBInit.test @@ -9,7 +9,7 @@ # RUN: env HOME=%t.home %lldb-init -local-lldbinit -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=ALLOWINIT --check-prefix=NOINIT # RUN: %lldb -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=NOINIT --check-prefix=CHECK -# WARNINIT: There is a .lldbinit file in the current directory which is not being read. +# WARNINIT: warning: There is a .lldbinit file in the current directory which is not being read. # NOINIT-NOT: There is a .lldbinit file in the current directory which is not being read. # CHECK-NOT: bogus # ALLOWINIT: name 'prlnt' is not defined diff --git a/lldb/test/Shell/Expr/TestExprLanguageNote.test b/lldb/test/Shell/Expr/TestExprLanguageNote.test index 7d8c702..e8e4e13 100644 --- a/lldb/test/Shell/Expr/TestExprLanguageNote.test +++ b/lldb/test/Shell/Expr/TestExprLanguageNote.test @@ -1,5 +1,3 @@ -# REQUIRES: (system-windows && lld) || !system-windows - # RUN: split-file %s %t # RUN: %clang_host -g %t/main.cpp -o %t.out # @@ -29,7 +27,7 @@ run expr blah # CHECK-TARGET: (lldb) expr -# CHECK-TARGET: note: Ran expression as 'C++{{.*}}' +# CHECK-TARGET: note: Ran expression as '{{(ISO )?}}C++{{.*}}' expr -l objc -- blah diff --git a/lldb/test/Shell/SymbolFile/NativePDB/simple-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/simple-types.cpp new file mode 100644 index 0000000..403cd29 --- /dev/null +++ b/lldb/test/Shell/SymbolFile/NativePDB/simple-types.cpp @@ -0,0 +1,127 @@ +// REQUIRES: lld + +// Test that simple types can be found +// RUN: %build --std=c++20 --nodefaultlib --compiler=clang-cl --arch=64 -o %t.exe -- %s +// RUN: lldb-test symbols %t.exe | FileCheck %s +// RUN: lldb-test symbols %t.exe | FileCheck --check-prefix=FUNC-PARAMS %s + +bool *PB; +bool &RB = *PB; +bool *&RPB = PB; +const bool &CRB = RB; +bool *const BC = 0; +const bool *const CBC = 0; + +long AL[2]; + +const volatile short CVS = 0; +const short CS = 0; +volatile short VS; + +struct ReturnedStruct1 {}; +struct ReturnedStruct2 {}; + +struct MyStruct { + static ReturnedStruct1 static_fn(char *) { return {}; } + ReturnedStruct2 const_member_fn(char *) const { return {}; } + void volatile_member_fn() volatile {}; + void member_fn() {}; +}; + +void (*PF)(int, bool *, const float, double, ...); + +using Func = void(char16_t, MyStruct &); +Func *PF2; + +using SomeTypedef = long; +SomeTypedef ST; + +int main() { + bool b; + char c; + unsigned char uc; + char8_t c8; + + short s; + unsigned short us; + wchar_t wc; + char16_t c16; + + int i; + unsigned int ui; + long l; + unsigned long ul; + char32_t c32; + + long long ll; + unsigned long long ull; + + MyStruct my_struct; + + decltype(nullptr) np; +} + +// CHECK-DAG: Type{{.*}} , name = "std::nullptr_t", size = 0, compiler_type = 0x{{[0-9a-f]+}} nullptr_t + +// CHECK-DAG: Type{{.*}} , name = "bool", size = 1, compiler_type = 0x{{[0-9a-f]+}} _Bool +// CHECK-DAG: Type{{.*}} , name = "char", size = 1, compiler_type = 0x{{[0-9a-f]+}} char +// CHECK-DAG: Type{{.*}} , name = "unsigned char", size = 1, compiler_type = 0x{{[0-9a-f]+}} unsigned char +// CHECK-DAG: Type{{.*}} , name = "char8_t", size = 1, compiler_type = 0x{{[0-9a-f]+}} char8_t + +// CHECK-DAG: Type{{.*}} , size = 2, compiler_type = 0x{{[0-9a-f]+}} short +// CHECK-DAG: Type{{.*}} , name = "const volatile ", size = 2, compiler_type = 0x{{[0-9a-f]+}} const volatile short +// CHECK-DAG: Type{{.*}} , name = "const ", size = 2, compiler_type = 0x{{[0-9a-f]+}} const short +// CHECK-DAG: Type{{.*}} , name = "volatile ", size = 2, compiler_type = 0x{{[0-9a-f]+}} volatile short + +// CHECK-DAG: Type{{.*}} , name = "unsigned short", size = 2, compiler_type = 0x{{[0-9a-f]+}} unsigned short +// CHECK-DAG: Type{{.*}} , name = "wchar_t", size = 2, compiler_type = 0x{{[0-9a-f]+}} wchar_t +// CHECK-DAG: Type{{.*}} , name = "char16_t", size = 2, compiler_type = 0x{{[0-9a-f]+}} char16_t + +// CHECK-DAG: Type{{.*}} , name = "int", size = 4, compiler_type = 0x{{[0-9a-f]+}} int +// CHECK-DAG: Type{{.*}} , name = "unsigned", size = 4, compiler_type = 0x{{[0-9a-f]+}} unsigned int +// CHECK-DAG: Type{{.*}} , name = "long", size = 4, compiler_type = 0x{{[0-9a-f]+}} long +// CHECK-DAG: Type{{.*}} , name = "unsigned long", size = 4, compiler_type = 0x{{[0-9a-f]+}} unsigned long +// CHECK-DAG: Type{{.*}} , name = "char32_t", size = 4, compiler_type = 0x{{[0-9a-f]+}} char32_t + +// CHECK-DAG: Type{{.*}} , name = "int64_t", size = 8, compiler_type = 0x{{[0-9a-f]+}} long long +// CHECK-DAG: Type{{.*}} , name = "uint64_t", size = 8, compiler_type = 0x{{[0-9a-f]+}} unsigned long long + +// CHECK-DAG: Type{{.*}} , name = "float", size = 4, compiler_type = 0x{{[0-9a-f]+}} float +// CHECK-DAG: Type{{.*}} , name = "const float", size = 4, compiler_type = 0x{{[0-9a-f]+}} const float + +// CHECK-DAG: Type{{.*}} , name = "ReturnedStruct1", size = 1, decl = simple-types.cpp:21, compiler_type = 0x{{[0-9a-f]+}} struct ReturnedStruct1 { +// CHECK-DAG: Type{{.*}} , name = "ReturnedStruct2", size = 1, decl = simple-types.cpp:22, compiler_type = 0x{{[0-9a-f]+}} struct ReturnedStruct2 { +// CHECK-DAG: Type{{.*}} , name = "MyStruct", size = 1, decl = simple-types.cpp:24, compiler_type = 0x{{[0-9a-f]+}} struct MyStruct { + +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} struct MyStruct *const +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} const struct MyStruct *const +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} volatile struct MyStruct *const +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} struct MyStruct & + +// CHECK-DAG: Type{{.*}} , name = "const bool", size = 1, compiler_type = 0x{{[0-9a-f]+}} const _Bool +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} _Bool & +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} _Bool * +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} _Bool *& +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} const _Bool & +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} _Bool *const +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} const _Bool *const + +// CHECK-DAG: Type{{.*}} , name = "SomeTypedef", size = 4, compiler_type = 0x{{[0-9a-f]+}} typedef SomeTypedef +// CHECK-DAG: Type{{.*}} , name = "Func", size = 0, compiler_type = 0x{{[0-9a-f]+}} typedef Func + +// CHECK-DAG: Type{{.*}} , size = 0, compiler_type = 0x{{[0-9a-f]+}} int (void) +// CHECK-DAG: Type{{.*}} , size = 0, compiler_type = 0x{{[0-9a-f]+}} void (void) + +// CHECK-DAG: Type{{.*}} , size = 0, compiler_type = 0x{{[0-9a-f]+}} void (int, _Bool *, const float, double, ...) +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} void (*)(int, _Bool *, const float, double, ...) + +// CHECK-DAG: Type{{.*}} , size = 0, compiler_type = 0x{{[0-9a-f]+}} void (char16_t, struct MyStruct &) +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} void (*)(char16_t, struct MyStruct &) + +// CHECK-DAG: Type{{.*}} , size = 0, compiler_type = 0x{{[0-9a-f]+}} struct ReturnedStruct1 (char *) +// CHECK-DAG: Type{{.*}} , size = 0, compiler_type = 0x{{[0-9a-f]+}} struct ReturnedStruct2 (char *) + +// CHECK-DAG: Type{{.*}} , size = 8, compiler_type = 0x{{[0-9a-f]+}} long[2] + +// double is used as a parameter to `PF`, but not created as an LLDB type +// FUNC-PARAMS-NOT: Type{{.*}} , name = "double" diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py index caaa14f..a5a7e99 100755 --- a/lldb/test/Shell/helper/build.py +++ b/lldb/test/Shell/helper/build.py @@ -9,12 +9,8 @@ import subprocess import sys if sys.platform == "win32": - # This module was renamed in Python 3. Make sure to import it using a - # consistent name regardless of python version. - try: - import winreg - except: - import _winreg as winreg + import winreg + if __name__ != "__main__": raise RuntimeError("Do not import this script, run it instead") |