DavidSpickett created this revision.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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 <https://reviews.llvm.org/D135170>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135352

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


Index: lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
===================================================================
--- lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
+++ lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
@@ -26,7 +26,8 @@
   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 @@
       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 @@
   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 @@
   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;
Index: 
lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
===================================================================
--- 
lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
+++ 
lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
@@ -34,6 +34,7 @@
 
         # 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 @@
         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")


Index: lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
===================================================================
--- lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
+++ lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
@@ -26,7 +26,8 @@
   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 @@
       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 @@
   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 @@
   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;
Index: lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
===================================================================
--- lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
+++ lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
@@ -34,6 +34,7 @@
 
         # 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 @@
         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")
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to