-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC] Precommit test for issue #149512 #153541
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
Conversation
|
@llvm/pr-subscribers-clang Author: None (Ami-zhang) ChangesFull diff: https://github.com/llvm/llvm-project/pull/153541.diff 1 Files Affected:
diff --git a/clang/test/CodeGen/LoongArch/targetattr-lasx.c b/clang/test/CodeGen/LoongArch/targetattr-lasx.c
new file mode 100644
index 0000000000000..826180c73120f
--- /dev/null
+++ b/clang/test/CodeGen/LoongArch/targetattr-lasx.c
@@ -0,0 +1,16 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --version 5
+// RUN: %clang_cc1 -triple loongarch64 -target-feature -lsx -emit-llvm %s -o - | FileCheck %s
+
+__attribute__((target("lasx")))
+// CHECK-LABEL: define dso_local void @testlasx(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+// CHECK-NEXT: [[ENTRY:.*:]]
+// CHECK-NEXT: ret void
+//
+void testlasx() {}
+//.
+// CHECK: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+64bit,+lasx,-lsx" }
+//.
+// CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
+// CHECK: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
+//.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid frequent test updates due to unrelated compiler changes in the future, I tend to only check function attributes: "target-features"="+64bit,+lasx,-lsx".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify the test.
(cherry picked from commit 793a6b4)
…153542) Currently, `__attribute__((target("lasx")))` does not automatically enable LSX support, causing Clang to fail with `-mno-lsx`. Since LASX depends on LSX, enabling LASX should implicitly enable LSX to avoid clang error. Fixes llvm#149512. Depends on llvm#153541 (cherry picked from commit a1b6e7f)
No description provided.