[clang] [Clang] Fix failing CI with different test case attribute & test macro (PR #76863)

Yuxuan Chen via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 3 12:43:18 PST 2024


https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/76863

As in title, https://github.com/llvm/llvm-project/commit/a8f43974260ec244d78336d2530f8fc097753580 broke CI due to the calling convention not available on certain targets. This patch uses a simpler calling convention and enables the test only when the attribute exists. It's verified that this test crashes the compiler before a8f43974260ec244d78336d2530f8fc097753580 so it's the same effect as the previous test. Disabling the test on platforms that don't have the calling convention is fine because it's guarding against a frontend bug. 

>From a51fcbc766cddbee5a0ec5e75c7b716ddb952a72 Mon Sep 17 00:00:00 2001
From: Yuxuan Chen <ych at meta.com>
Date: Wed, 3 Jan 2024 12:18:21 -0800
Subject: [PATCH] Use a different calling convention attribute

---
 clang/test/SemaCXX/template-instantiation.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/clang/test/SemaCXX/template-instantiation.cpp b/clang/test/SemaCXX/template-instantiation.cpp
index e714e070a206f5..a8ecafc401d9d0 100644
--- a/clang/test/SemaCXX/template-instantiation.cpp
+++ b/clang/test/SemaCXX/template-instantiation.cpp
@@ -3,13 +3,15 @@
 
 namespace GH76521 {
 
+#if __has_attribute(preserve_most)
 template <typename T>
 void foo() {
-  auto l = []() __attribute__((pcs("aapcs-vfp"))) {};
+  auto l = []() __attribute__((preserve_most)) {};
 }
 
 void bar() {
   foo<int>();
 }
+#endif
 
 }



More information about the cfe-commits mailing list