[clang] dca37af - [NFC][Clang] Modify expect of fail test or XFAIL because CSKY align is different

Zi Xuan Wu via cfe-commits cfe-commits at lists.llvm.org
Tue May 17 19:53:58 PDT 2022


Author: Zi Xuan Wu (Zeson)
Date: 2022-05-18T10:53:30+08:00
New Revision: dca37af061fbe6590399dfb4e3fd3dda16d63144

URL: https://github.com/llvm/llvm-project/commit/dca37af061fbe6590399dfb4e3fd3dda16d63144
DIFF: https://github.com/llvm/llvm-project/commit/dca37af061fbe6590399dfb4e3fd3dda16d63144.diff

LOG: [NFC][Clang] Modify expect of fail test or XFAIL because CSKY align is different

CSKY is always in 4-byte align, no matter it's long long type.
For global aggregate variable, it's 4-byte align if its size is bigger than or equal to 4 bytes.

Differential Revision: https://reviews.llvm.org/D124977

Added: 
    

Modified: 
    clang/test/CodeGen/c-strings.c
    clang/test/Sema/builtin-alloca-with-align.c

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/c-strings.c b/clang/test/CodeGen/c-strings.c
index 085380101554..e783b6cb6ad0 100644
--- a/clang/test/CodeGen/c-strings.c
+++ b/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 @@ void f4(void) {
 }
 
 char x[3] = "ola";
-

diff  --git a/clang/test/Sema/builtin-alloca-with-align.c b/clang/test/Sema/builtin-alloca-with-align.c
index cac171f0e7ea..0a3e0f6a2022 100644
--- a/clang/test/Sema/builtin-alloca-with-align.c
+++ b/clang/test/Sema/builtin-alloca-with-align.c
@@ -30,4 +30,8 @@ void test7(int a) {
 
 void test8(void) {
   __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}}
+#if defined(__csky__)
+  // expected-error at -1 {{requested alignment must be 8 or greater}}
+  // Because the alignment of long long is 4 in CSKY target
+#endif
 }


        


More information about the cfe-commits mailing list