[Openmp-commits] [openmp] [OpenMP] [test] Skip the -mlong-double-80 test on MSVC ABI (PR #81115)

Martin Storsjö via Openmp-commits openmp-commits at lists.llvm.org
Thu Feb 8 01:51:54 PST 2024


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/81115

Within the MSVC ABI, long doubles are the same as regular 64 bit doubles. This test case, which is compiled with -mlong-double-80, cannot work when libomp has been compiled without that flag, as -mlong-double-80 changes the calling convention for the tested functions.

>From 3a96b88c8d6f9b254f9085ad247895c7fc99ad11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Wed, 7 Feb 2024 15:37:30 +0200
Subject: [PATCH] [OpenMP] [test] Skip the -mlong-double-80 test on MSVC ABI

Within the MSVC ABI, long doubles are the same as regular 64 bit
doubles. This test case, which is compiled with -mlong-double-80,
cannot work when libomp has been compiled without that flag, as
-mlong-double-80 changes the calling convention for the tested
functions.
---
 openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c b/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
index 82d8cbc19d7a16..72ba1eeb643ef1 100644
--- a/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
+++ b/openmp/runtime/test/atomic/kmp_atomic_float10_max_min.c
@@ -28,7 +28,7 @@ extern long double __kmpc_atomic_float10_min_cpt(ident_t *id_ref, int gtid,
 
 int main() {
   int ret = 0;
-#if KMP_ARCH_X86 || KMP_ARCH_X86_64
+#if (KMP_ARCH_X86 || KMP_ARCH_X86_64) && !defined(_MSC_VER)
   long double s = 012.3456; // small
   long double e = 123.4567; // middle
   long double d = 234.5678; // big
@@ -158,6 +158,6 @@ int main() {
     printf("passed\n");
 #else
   printf("Unsupported architecture, skipping test...\n");
-#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
+#endif // (KMP_ARCH_X86 || KMP_ARCH_X86_64) && !defined(_MSC_VER)
   return ret;
 }



More information about the Openmp-commits mailing list