From 061da546b983eb767bad15e67af1174fb0bcf31c Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 3 Aug 2020 14:33:06 +0000 Subject: Import LLVM 10.0.0 release including clang, lld and lldb. ok hackroom tested by plenty --- .../test/lang/cpp/offsetof/TestOffsetofCpp.py | 4 ++++ .../lldbsuite/test/lang/cpp/offsetof/main.cpp | 25 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/TestOffsetofCpp.py create mode 100644 gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/main.cpp (limited to 'gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof') diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/TestOffsetofCpp.py b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/TestOffsetofCpp.py new file mode 100644 index 00000000000..cdfbaae0ce3 --- /dev/null +++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/TestOffsetofCpp.py @@ -0,0 +1,4 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest(__file__, globals(), [decorators.no_debug_info_test]) diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/main.cpp b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/main.cpp new file mode 100644 index 00000000000..ab379f839c8 --- /dev/null +++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/cpp/offsetof/main.cpp @@ -0,0 +1,25 @@ +#include + +class Base { + int32_t a; +}; +class Class1 : Base { +public: + int32_t b; +}; + +class EmptyBase { +}; +class Class2 : EmptyBase { +public: + int32_t b; +}; + +int main(int argc, char **argv) { + Class1 c1; + Class2 c2; + //% self.expect("expr offsetof(Base, a)", substrs=["= 0"]) + //% self.expect("expr offsetof(Class1, b)", substrs=["= 4"]) + //% self.expect("expr offsetof(Class2, b)", substrs=["= 0"]) + return c1.b + c2.b; +} -- cgit v1.2.3-59-g8ed1b