diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 25 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/Makefile b/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/Makefile new file mode 100644 index 00000000000..99bfa7e03b4 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/Makefile @@ -0,0 +1,3 @@ +LEVEL = ../../../make +CXX_SOURCES := main.cpp +include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py new file mode 100644 index 00000000000..9f8ed89375e --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/TestThreadLocal.py @@ -0,0 +1,5 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest(__file__, globals(), + lldbinline.expectedFailureAll(oslist=["windows", "linux"])) diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/main.cpp new file mode 100644 index 00000000000..1855b7c5f34 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/thread_local/main.cpp @@ -0,0 +1,17 @@ +int storage = 45; +thread_local int tl_global_int = 123; +thread_local int *tl_global_ptr = &storage; + +int main(int argc, char **argv) { + //% self.expect("expr tl_local_int", error=True, substrs=["couldn't get the value of variable tl_local_int"]) + //% self.expect("expr *tl_local_ptr", error=True, substrs=["couldn't get the value of variable tl_local_ptr"]) + thread_local int tl_local_int = 321; + thread_local int *tl_local_ptr = nullptr; + tl_local_ptr = &tl_local_int; + tl_local_int++; + //% self.expect("expr tl_local_int + 1", substrs=["int", "= 323"]) + //% self.expect("expr *tl_local_ptr + 2", substrs=["int", "= 324"]) + //% self.expect("expr tl_global_int", substrs=["int", "= 123"]) + //% self.expect("expr *tl_global_ptr", substrs=["int", "= 45"]) + return 0; +} |