Skip to content

[Clang] Fix failing CI with different test case attribute & host triple #76863

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
Jan 3, 2024

Conversation

yuxuanchen1997
Copy link
Member

As in title, a8f4397 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 a8f4397 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.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 3, 2024

@llvm/pr-subscribers-clang

Author: Yuxuan Chen (yuxuanchen1997)

Changes

As in title, a8f4397 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 a8f4397 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 --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
 
 }

@erichkeane
Copy link
Collaborator

Is preserve_most enabled for all platforms? It looks like it'll eventually go to the TargetInfo::checkCallingConvention for each target, and I'm pretty sure we don't support it for all targets.

You're likely better off just adding a triple/handful of triples here.

@yuxuanchen1997
Copy link
Member Author

Like this?

Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, triple of x86_64 + gnu should be enough to make sure this is a supported attribute.

@yuxuanchen1997 yuxuanchen1997 changed the title [Clang] Fix failing CI with different test case attribute & test macro [Clang] Fix failing CI with different test case attribute & host triple Jan 3, 2024
@yuxuanchen1997 yuxuanchen1997 merged commit 09de5e5 into llvm:main Jan 3, 2024
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.

3 participants