Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

tbaederr
Copy link
Contributor

@tbaederr tbaederr commented Sep 3, 2024

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

The effect is the same, but this version doesn't take as long to
evaluate.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Sep 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2024

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

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 --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 {

@tbaederr tbaederr merged commit 9626e84 into llvm:main Sep 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants