summaryrefslogtreecommitdiff
path: root/lldb/test/API
diff options
context:
space:
mode:
authorStella Stamenova <stilis@microsoft.com>2022-07-14 10:47:01 -0700
committerStella Stamenova <stilis@microsoft.com>2022-07-14 10:47:01 -0700
commitc3a28e8a99a6672339a38c468f2519ace5659fa2 (patch)
tree2faa37d714aaa870220b467de74f927924ea0eba /lldb/test/API
parent64d63f4823afeeaa2f8abc256bfe14b89f4daeae (diff)
Revert "[lldb] Add support for using integral const static data members in the expression evaluator"
This reverts commit 486787210df5ce5eabadc90a7de353ae81101feb. This broke the windows lldb bot: https://lab.llvm.org/buildbot/#/builders/83/builds/21186
Diffstat (limited to 'lldb/test/API')
-rw-r--r--lldb/test/API/lang/cpp/const_static_integral_member/Makefile3
-rw-r--r--lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py94
-rw-r--r--lldb/test/API/lang/cpp/const_static_integral_member/main.cpp102
-rw-r--r--lldb/test/API/lang/cpp/const_static_integral_member_int128/Makefile3
-rw-r--r--lldb/test/API/lang/cpp/const_static_integral_member_int128/TestConstStaticIntegralMemberInt128.py31
-rw-r--r--lldb/test/API/lang/cpp/const_static_integral_member_int128/main.cpp18
6 files changed, 0 insertions, 251 deletions
diff --git a/lldb/test/API/lang/cpp/const_static_integral_member/Makefile b/lldb/test/API/lang/cpp/const_static_integral_member/Makefile
deleted file mode 100644
index 99998b20bcb0..000000000000
--- a/lldb/test/API/lang/cpp/const_static_integral_member/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-CXX_SOURCES := main.cpp
-
-include Makefile.rules
diff --git a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
deleted file mode 100644
index 86db78187aa8..000000000000
--- a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
+++ /dev/null
@@ -1,94 +0,0 @@
-"""
-Tests const static data members as specified by C++11 [class.static.data]p3.
-"""
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-class TestCase(TestBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- def test(self):
- self.build()
- lldbutil.run_to_source_breakpoint(self, "// break here",
- lldb.SBFileSpec("main.cpp"))
-
- # Test using a simple const static integer member.
- self.expect_expr("A::int_val", result_value="1")
-
- # Try accessing the int member via some expressions that still produce
- # an lvalue.
- self.expect_expr("a.int_val", result_value="1")
- self.expect_expr("(A::int_val)", result_value="1")
- self.expect_expr("+A::int_val", result_value="1")
- self.expect_expr("1,A::int_val", result_value="1")
- self.expect_expr("true ? A::int_val : A::int_val", result_value="1")
-
- # Test a simple integer member that was also defined in a namespace
- # scope and has an address.
- self.expect_expr("A::int_val_with_address", result_value="2")
-
- # Try to take the address of the data member. Should produce a linker
- # error only if the member doesn't have an address.
- self.expect("expr const int *i = &A::int_val; *i", error=True,
- substrs=["Couldn't lookup symbols:"])
- self.expect_expr("const int *i = &A::int_val_with_address; *i",
- result_value="2")
-
- # Test a bool member.
- self.expect_expr("A::bool_val", result_value="true")
-
- # Test that minimum and maximum values for each data type are right.
- self.expect_expr("A::char_max == char_max", result_value="true")
- self.expect_expr("A::uchar_max == uchar_max", result_value="true")
- self.expect_expr("A::int_max == int_max", result_value="true")
- self.expect_expr("A::uint_max == uint_max", result_value="true")
- self.expect_expr("A::long_max == long_max", result_value="true")
- self.expect_expr("A::ulong_max == ulong_max", result_value="true")
- self.expect_expr("A::longlong_max == longlong_max", result_value="true")
- self.expect_expr("A::ulonglong_max == ulonglong_max", result_value="true")
-
- self.expect_expr("A::char_min == char_min", result_value="true")
- self.expect_expr("A::uchar_min == uchar_min", result_value="true")
- self.expect_expr("A::int_min == int_min", result_value="true")
- self.expect_expr("A::uint_min == uint_min", result_value="true")
- self.expect_expr("A::long_min == long_min", result_value="true")
- self.expect_expr("A::ulong_min == ulong_min", result_value="true")
- self.expect_expr("A::longlong_min == longlong_min", result_value="true")
- self.expect_expr("A::ulonglong_min == ulonglong_min", result_value="true")
-
- # Test an unscoped enum.
- self.expect_expr("A::enum_val", result_value="enum_case2")
- # Test an unscoped enum with an invalid enum case.
- self.expect_expr("A::invalid_enum_val", result_value="enum_case1 | enum_case2 | 0x4")
-
- # Test a scoped enum.
- self.expect_expr("A::scoped_enum_val", result_value="scoped_enum_case2")
- # Test an scoped enum with an invalid enum case.
- self.expect_expr("A::invalid_scoped_enum_val", result_value="scoped_enum_case1 | 0x4")
-
- # Test an enum with fixed underlying type.
- self.expect_expr("A::scoped_char_enum_val", result_value="case2")
- self.expect_expr("A::scoped_ll_enum_val_neg", result_value="case0")
- self.expect_expr("A::scoped_ll_enum_val", result_value="case2")
-
- # Try to take the address of a member that doesn't have one.
- self.expect("expr const int *i = &A::int_val; *i", error=True,
- substrs=["Couldn't lookup symbols:"])
-
- # dsymutil strips the debug info for classes that only have const static
- # data members without a definition namespace scope.
- @expectedFailureAll(debug_info=["dsym"])
- def test_class_with_only_const_static(self):
- self.build()
- lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.cpp"))
-
- self.expect_expr("ClassWithOnlyConstStatic::member", result_value="3")
-
- # Test `constexpr static`.
- self.expect_expr("ClassWithConstexprs::member", result_value="2")
- self.expect_expr("ClassWithConstexprs::enum_val", result_value="enum_case2")
- self.expect_expr("ClassWithConstexprs::scoped_enum_val", result_value="scoped_enum_case2")
diff --git a/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp b/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
deleted file mode 100644
index 9762424f2345..000000000000
--- a/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-#include <limits>
-
-enum Enum {
- enum_case1 = 1,
- enum_case2 = 2,
-};
-
-enum class ScopedEnum {
- scoped_enum_case1 = 1,
- scoped_enum_case2 = 2,
-};
-
-enum class ScopedCharEnum : char {
- case1 = 1,
- case2 = 2,
-};
-
-enum class ScopedLongLongEnum : long long {
- case0 = std::numeric_limits<long long>::min(),
- case1 = 1,
- case2 = std::numeric_limits<long long>::max(),
-};
-
-struct A {
- const static int int_val = 1;
- const static int int_val_with_address = 2;
- const static bool bool_val = true;
-
- const static auto char_max = std::numeric_limits<signed char>::max();
- const static auto uchar_max = std::numeric_limits<unsigned char>::max();
- const static auto int_max = std::numeric_limits<int>::max();
- const static auto uint_max = std::numeric_limits<unsigned>::max();
- const static auto long_max = std::numeric_limits<long>::max();
- const static auto ulong_max = std::numeric_limits<unsigned long>::max();
- const static auto longlong_max = std::numeric_limits<long long>::max();
- const static auto ulonglong_max =
- std::numeric_limits<unsigned long long>::max();
-
- const static auto char_min = std::numeric_limits<char>::min();
- const static auto uchar_min = std::numeric_limits<unsigned char>::min();
- const static auto int_min = std::numeric_limits<int>::min();
- const static auto uint_min = std::numeric_limits<unsigned>::min();
- const static auto long_min = std::numeric_limits<long>::min();
- const static auto ulong_min = std::numeric_limits<unsigned long>::min();
- const static auto longlong_min = std::numeric_limits<long long>::min();
- const static auto ulonglong_min =
- std::numeric_limits<unsigned long long>::min();
-
- const static Enum enum_val = enum_case2;
- const static Enum invalid_enum_val = static_cast<Enum>(enum_case2 + 5);
- const static ScopedEnum scoped_enum_val = ScopedEnum::scoped_enum_case2;
- const static ScopedEnum invalid_scoped_enum_val = static_cast<ScopedEnum>(5);
- const static ScopedCharEnum scoped_char_enum_val = ScopedCharEnum::case2;
- const static ScopedLongLongEnum scoped_ll_enum_val_neg =
- ScopedLongLongEnum::case0;
- const static ScopedLongLongEnum scoped_ll_enum_val =
- ScopedLongLongEnum::case2;
-};
-
-const int A::int_val_with_address;
-
-struct ClassWithOnlyConstStatic {
- const static int member = 3;
-};
-
-struct ClassWithConstexprs {
- constexpr static int member = 2;
- constexpr static Enum enum_val = enum_case2;
- constexpr static ScopedEnum scoped_enum_val = ScopedEnum::scoped_enum_case2;
-} cwc;
-
-int main() {
- A a;
-
- auto char_max = A::char_max;
- auto uchar_max = A::uchar_max;
- auto int_max = A::int_max;
- auto uint_max = A::uint_max;
- auto long_max = A::long_max;
- auto ulong_max = A::ulong_max;
- auto longlong_max = A::longlong_max;
- auto ulonglong_max = A::ulonglong_max;
-
- auto char_min = A::char_min;
- auto uchar_min = A::uchar_min;
- auto int_min = A::int_min;
- auto uint_min = A::uint_min;
- auto long_min = A::long_min;
- auto ulong_min = A::ulong_min;
- auto longlong_min = A::longlong_min;
- auto ulonglong_min = A::ulonglong_min;
-
- int member_copy = ClassWithOnlyConstStatic::member;
-
- Enum e = A::enum_val;
- e = A::invalid_enum_val;
- ScopedEnum se = A::scoped_enum_val;
- se = A::invalid_scoped_enum_val;
- ScopedCharEnum sce = A::scoped_char_enum_val;
- ScopedLongLongEnum sle = A::scoped_ll_enum_val;
- return 0; // break here
-}
diff --git a/lldb/test/API/lang/cpp/const_static_integral_member_int128/Makefile b/lldb/test/API/lang/cpp/const_static_integral_member_int128/Makefile
deleted file mode 100644
index 99998b20bcb0..000000000000
--- a/lldb/test/API/lang/cpp/const_static_integral_member_int128/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-CXX_SOURCES := main.cpp
-
-include Makefile.rules
diff --git a/lldb/test/API/lang/cpp/const_static_integral_member_int128/TestConstStaticIntegralMemberInt128.py b/lldb/test/API/lang/cpp/const_static_integral_member_int128/TestConstStaticIntegralMemberInt128.py
deleted file mode 100644
index edf538334040..000000000000
--- a/lldb/test/API/lang/cpp/const_static_integral_member_int128/TestConstStaticIntegralMemberInt128.py
+++ /dev/null
@@ -1,31 +0,0 @@
-"""
-Tests const static data members as specified by C++11 [class.static.data]p3
-with (u)int128_t types.
-"""
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-class TestCase(TestBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- def test_int128(self):
- self.build()
- lldbutil.run_to_source_breakpoint(self, "// break here",
- lldb.SBFileSpec("main.cpp"))
-
- # Try to use the (u)int128_t data members which are not supported at
- # the moment. Just verify that LLDB doesn't report an incorrect value
- # for them and just treats them as normal variables (which will lead
- # to linker errors as they are not defined anywhere).
- self.expect("expr A::int128_max", error=True,
- substrs=["Couldn't lookup symbols:"])
- self.expect("expr A::uint128_max", error=True,
- substrs=["Couldn't lookup symbols:"])
- self.expect("expr A::int128_min", error=True,
- substrs=["Couldn't lookup symbols:"])
- self.expect("expr A::uint128_min", error=True,
- substrs=["Couldn't lookup symbols:"])
diff --git a/lldb/test/API/lang/cpp/const_static_integral_member_int128/main.cpp b/lldb/test/API/lang/cpp/const_static_integral_member_int128/main.cpp
deleted file mode 100644
index bac996d5f66d..000000000000
--- a/lldb/test/API/lang/cpp/const_static_integral_member_int128/main.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <limits>
-
-struct A {
- const static auto uint128_max = std::numeric_limits<__uint128_t>::max();
- const static auto uint128_min = std::numeric_limits<__uint128_t>::min();
- const static auto int128_max = std::numeric_limits<__int128_t>::max();
- const static auto int128_min = std::numeric_limits<__int128_t>::min();
-};
-
-int main() {
- A a;
-
- auto int128_max = A::int128_max;
- auto uint128_max = A::uint128_max;
- auto int128_min = A::int128_min;
- auto uint128_min = A::uint128_min;
- return 0; // break here
-}