[PATCH] D124977: [NFC][Clang] Modify expect of fail test or XFAIL because CSKY align is different
Zixuan Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 4 21:16:58 PDT 2022
zixuan-wu created this revision.
zixuan-wu added reviewers: majnemer, kparzysz, ddunbar.
Herald added a project: All.
zixuan-wu requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
CSKY is always in 4-byte align, no matter it's long long type. For aggregate type, it's 4-byte align if its size is bigger than or equal to 4 bytes.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D124977
Files:
clang/test/CodeGen/c-strings.c
clang/test/Sema/builtin-alloca-with-align.c
Index: clang/test/Sema/builtin-alloca-with-align.c
===================================================================
--- clang/test/Sema/builtin-alloca-with-align.c
+++ clang/test/Sema/builtin-alloca-with-align.c
@@ -29,5 +29,10 @@
}
void test8(void) {
+#if defined(__csky__)
__builtin_alloca_with_align(sizeof(__INT64_TYPE__), __alignof__(__INT64_TYPE__)); // expected-warning {{second argument to __builtin_alloca_with_align is supposed to be in bits}}
+ // expected-error at -1 {{requested alignment must be 8 or greater}}
+#else
+ __builtin_alloca_with_align(sizeof(__INT64_TYPE__), __alignof__(__INT64_TYPE__)); // expected-warning {{second argument to __builtin_alloca_with_align is supposed to be in bits}}
+#endif
}
Index: clang/test/CodeGen/c-strings.c
===================================================================
--- clang/test/CodeGen/c-strings.c
+++ clang/test/CodeGen/c-strings.c
@@ -20,6 +20,11 @@
// fails the check for "@f3.x = ... align [ALIGN]", since ALIGN is derived
// from the alignment of a single i8, which is still 1.
+// XFAIL: csky
+// CSKY aligns arrays of size 4+ bytes to a 32-bit boundary, which
+// fails the check for "@f2.x = ... align [ALIGN]", since ALIGN is derived
+// from the alignment of a single i8, which is still 1.
+
#if defined(__s390x__)
unsigned char align = 2;
#else
@@ -69,4 +74,3 @@
}
char x[3] = "ola";
-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124977.427186.patch
Type: text/x-patch
Size: 1466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220505/6020b8c3/attachment.bin>
More information about the cfe-commits
mailing list