[Lldb-commits] [lldb] b3d4d9c - [LLDB] Complete set of char tests for static integral members

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 10 04:16:28 PDT 2022


Author: David Spickett
Date: 2022-10-10T11:16:19Z
New Revision: b3d4d9ced17c5b3ebd6bf5b61731ddcdde3cbca5

URL: https://github.com/llvm/llvm-project/commit/b3d4d9ced17c5b3ebd6bf5b61731ddcdde3cbca5
DIFF: https://github.com/llvm/llvm-project/commit/b3d4d9ced17c5b3ebd6bf5b61731ddcdde3cbca5.diff

LOG: [LLDB] Complete set of char tests for static integral members

Previously we had a bit of a mix of "signed char" "unsigned char" and
"char".

This adds seperate min and max checks for all three types.

Depends on D135170

Reviewed By: Michael137

Differential Revision: https://reviews.llvm.org/D135352

Added: 
    

Modified: 
    lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
    lldb/test/API/lang/cpp/const_static_integral_member/main.cpp

Removed: 
    


################################################################################
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
index 5252247191383..91ed14ed48ab7 100644
--- a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
+++ b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
@@ -34,6 +34,7 @@ def test(self):
 
         # 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::schar_max == schar_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")
@@ -43,6 +44,7 @@ def test(self):
         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::schar_min == schar_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")

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
index 977e12295760a..09ab9e6698132 100644
--- a/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
+++ b/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
@@ -26,7 +26,8 @@ struct A {
   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 char_max = std::numeric_limits<char>::max();
+  const static auto schar_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();
@@ -37,6 +38,7 @@ struct A {
       std::numeric_limits<unsigned long long>::max();
 
   const static auto char_min = std::numeric_limits<char>::min();
+  const static auto schar_min = std::numeric_limits<signed 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();
@@ -83,6 +85,7 @@ int main() {
   A a;
 
   auto char_max = A::char_max;
+  auto schar_max = A::schar_max;
   auto uchar_max = A::uchar_max;
   auto int_max = A::int_max;
   auto uint_max = A::uint_max;
@@ -92,6 +95,7 @@ int main() {
   auto ulonglong_max = A::ulonglong_max;
 
   auto char_min = A::char_min;
+  auto schar_min = A::schar_min;
   auto uchar_min = A::uchar_min;
   auto int_min = A::int_min;
   auto uint_min = A::uint_min;


        


More information about the lldb-commits mailing list