[clang] [SystemZ] Move new test into existing CodeGen test. (PR #73230)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 23 03:38:10 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Jonas Paulsson (JonPsson1)

<details>
<summary>Changes</summary>

The test for emitted alignments is better placed in CodeGen.


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


2 Files Affected:

- (modified) clang/test/CodeGen/SystemZ/align-systemz.c (+13) 
- (removed) clang/test/Driver/systemz-alignment.c (-32) 


``````````diff
diff --git a/clang/test/CodeGen/SystemZ/align-systemz.c b/clang/test/CodeGen/SystemZ/align-systemz.c
index 5ba446665fef803..9daff6ee9760974 100644
--- a/clang/test/CodeGen/SystemZ/align-systemz.c
+++ b/clang/test/CodeGen/SystemZ/align-systemz.c
@@ -25,6 +25,19 @@ void func (void)
   s = es;
 }
 
+// Test that a global variable with an incomplete type gets the minimum
+// alignment of 2 per the ABI if no alignment was specified by user.
+//
+// CHECK-DAG: @VarNoAl {{.*}} align 2
+// CHECK-DAG: @VarExplAl1  {{.*}} align 1
+// CHECK-DAG: @VarExplAl4  {{.*}} align 4
+struct incomplete_ty;
+extern struct incomplete_ty VarNoAl;
+extern struct incomplete_ty __attribute__((aligned(1))) VarExplAl1;
+extern struct incomplete_ty __attribute__((aligned(4))) VarExplAl4;
+struct incomplete_ty *fun0 (void) { return &VarNoAl; }
+struct incomplete_ty *fun1 (void) { return &VarExplAl1; }
+struct incomplete_ty *fun2 (void) { return &VarExplAl4; }
 
 // The SystemZ ABI aligns __int128_t to only eight bytes.
 
diff --git a/clang/test/Driver/systemz-alignment.c b/clang/test/Driver/systemz-alignment.c
deleted file mode 100644
index 6f3b2bc38be3688..000000000000000
--- a/clang/test/Driver/systemz-alignment.c
+++ /dev/null
@@ -1,32 +0,0 @@
-// RUN: %clang --target=s390x-linux -S -emit-llvm -o - %s | FileCheck %s
-//
-// Test that a global variable with an incomplete type gets the minimum
-// alignment of 2 per the ABI if no alignment was specified by user.
-//
-// CHECK:      @VarNoAl {{.*}} align 2
-// CHECK-NEXT: @VarExplAl1  {{.*}} align 1
-// CHECK-NEXT: @VarExplAl4  {{.*}} align 4
-
-// No alignemnt specified by user.
-struct incomplete_ty_noal;
-extern struct incomplete_ty_noal VarNoAl;
-struct incomplete_ty_noal *fun0 (void)
-{
-  return &VarNoAl;
-}
-
-// User-specified alignment of 1.
-struct incomplete_ty_al1;
-extern struct incomplete_ty_al1 __attribute__((aligned(1))) VarExplAl1;
-struct incomplete_ty_al1 *fun1 (void)
-{
-  return &VarExplAl1;
-}
-
-// User-specified alignment of 4.
-struct incomplete_ty_al4;
-extern struct incomplete_ty_al4 __attribute__((aligned(4))) VarExplAl4;
-struct incomplete_ty_al4 *fun2 (void)
-{
-  return &VarExplAl4;
-}

``````````

</details>


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


More information about the cfe-commits mailing list