[libc-commits] [PATCH] D153137: [libc][nfc] Silence two warnings in tests

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jun 16 06:43:16 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: lntue, michaelrj, sivachandra.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
jhuber6 requested review of this revision.

These currently give warnings for unused variables or a default case
where everything is covered.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153137

Files:
  libc/test/UnitTest/RoundingModeUtils.cpp
  libc/test/src/__support/uint_test.cpp


Index: libc/test/src/__support/uint_test.cpp
===================================================================
--- libc/test/src/__support/uint_test.cpp
+++ libc/test/src/__support/uint_test.cpp
@@ -25,7 +25,6 @@
 using LL_Int192 = __llvm_libc::cpp::Int<192>;
 
 TEST(LlvmLibcUIntClassTest, BasicInit) {
-  LL_UInt128 empty;
   LL_UInt128 half_val(12345);
   LL_UInt128 full_val({12345, 67890});
   ASSERT_TRUE(half_val != full_val);
Index: libc/test/UnitTest/RoundingModeUtils.cpp
===================================================================
--- libc/test/UnitTest/RoundingModeUtils.cpp
+++ libc/test/UnitTest/RoundingModeUtils.cpp
@@ -20,19 +20,14 @@
   switch (mode) {
   case RoundingMode::Upward:
     return FE_UPWARD;
-    break;
   case RoundingMode::Downward:
     return FE_DOWNWARD;
-    break;
   case RoundingMode::TowardZero:
     return FE_TOWARDZERO;
-    break;
   case RoundingMode::Nearest:
     return FE_TONEAREST;
-    break;
-  default:
-    __builtin_unreachable();
   }
+  __builtin_unreachable();
 }
 
 ForceRoundingMode::ForceRoundingMode(RoundingMode mode) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153137.532128.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230616/13d1515c/attachment.bin>


More information about the libc-commits mailing list