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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Yuxuan Chen (yuxuanchen1997)

<details>
<summary>Changes</summary>

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. 

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


1 Files Affected:

- (modified) clang/test/SemaCXX/template-instantiation.cpp (+3-1) 


``````````diff
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
 
 }

``````````

</details>


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


More information about the cfe-commits mailing list