Author: Jonas Paulsson Date: 2023-11-23T13:27:05+01:00 New Revision: 521b4682a55eb735b75e08d5f71c8cbe47395e40
URL: https://github.com/llvm/llvm-project/commit/521b4682a55eb735b75e08d5f71c8cbe47395e40 DIFF: https://github.com/llvm/llvm-project/commit/521b4682a55eb735b75e08d5f71c8cbe47395e40.diff LOG: [SystemZ] Move new test into existing CodeGen test. (#73230) The test for emitted alignments is better placed in CodeGen. Added: Modified: clang/test/CodeGen/SystemZ/align-systemz.c Removed: clang/test/Driver/systemz-alignment.c ################################################################################ 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; -} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits