[clang] [clang][bytecode][NFC] Simplify builtin-functions.cpp (PR #107118)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 3 07:54:01 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

The effect is the same, but this version doesn't take as long to evaluate.

---
Full diff: https://github.com/llvm/llvm-project/pull/107118.diff


1 Files Affected:

- (modified) clang/test/AST/ByteCode/builtin-functions.cpp (+20-9) 


``````````diff
diff --git a/clang/test/AST/ByteCode/builtin-functions.cpp b/clang/test/AST/ByteCode/builtin-functions.cpp
index e215597579224c..9c9ca23e0a6a69 100644
--- a/clang/test/AST/ByteCode/builtin-functions.cpp
+++ b/clang/test/AST/ByteCode/builtin-functions.cpp
@@ -227,15 +227,26 @@ namespace floating_comparison {
   !__builtin_islessgreater(X, Y) && !__builtin_islessgreater(Y, X) &&    \
   __builtin_isunordered(X, Y) && __builtin_isunordered(Y, X)
 
-  static_assert(
-    LESS(0.0, 1.0) && EQUAL(1.0, 1.0) && EQUAL(0.0, -0.0) &&
-    UNORDERED(__builtin_nan(""), 1.0) && UNORDERED(__builtin_nan(""), __builtin_inf()) && LESS(0.0, __builtin_inf()) &&
-    LESS(0.0f, 1.0f) && EQUAL(1.0f, 1.0f) && EQUAL(0.0f, -0.0f) &&
-    UNORDERED(__builtin_nanf(""), 1.0f) && UNORDERED(__builtin_nanf(""), __builtin_inff()) && LESS(0.0f, __builtin_inff()) &&
-    LESS(0.0L, 1.0L) && EQUAL(1.0L, 1.0L) && EQUAL(0.0L, -0.0L) &&
-    UNORDERED(__builtin_nanl(""), 1.0L) && UNORDERED(__builtin_nanl(""), __builtin_infl()) && LESS(0.0L, __builtin_infl()) &&
-    true, ""
-  );
+  static_assert(LESS(0.0, 1.0));
+  static_assert(LESS(0.0, __builtin_inf()));
+  static_assert(LESS(0.0f, 1.0f));
+  static_assert(LESS(0.0f, __builtin_inff()));
+  static_assert(LESS(0.0L, 1.0L));
+  static_assert(LESS(0.0L, __builtin_infl()));
+
+  static_assert(EQUAL(1.0, 1.0));
+  static_assert(EQUAL(0.0, -0.0));
+  static_assert(EQUAL(1.0f, 1.0f));
+  static_assert(EQUAL(0.0f, -0.0f));
+  static_assert(EQUAL(1.0L, 1.0L));
+  static_assert(EQUAL(0.0L, -0.0L));
+
+  static_assert(UNORDERED(__builtin_nan(""), 1.0));
+  static_assert(UNORDERED(__builtin_nan(""), __builtin_inf()));
+  static_assert(UNORDERED(__builtin_nanf(""), 1.0f));
+  static_assert(UNORDERED(__builtin_nanf(""), __builtin_inff()));
+  static_assert(UNORDERED(__builtin_nanl(""), 1.0L));
+  static_assert(UNORDERED(__builtin_nanl(""), __builtin_infl()));
 }
 
 namespace fpclassify {

``````````

</details>


https://github.com/llvm/llvm-project/pull/107118


More information about the cfe-commits mailing list