diff options
author | Jonas Paulsson <paulson1@linux.ibm.com> | 2023-11-23 13:27:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-23 13:27:05 +0100 |
commit | 521b4682a55eb735b75e08d5f71c8cbe47395e40 (patch) | |
tree | 2c3dced4a9c636d88b2ba5f3242b176eb21bd465 | |
parent | ce1b24330efb242172324e39099668dcc15c21f0 (diff) | |
download | llvm-521b4682a55eb735b75e08d5f71c8cbe47395e40.zip llvm-521b4682a55eb735b75e08d5f71c8cbe47395e40.tar.gz llvm-521b4682a55eb735b75e08d5f71c8cbe47395e40.tar.bz2 |
[SystemZ] Move new test into existing CodeGen test. (#73230)
The test for emitted alignments is better placed in CodeGen.
-rw-r--r-- | clang/test/CodeGen/SystemZ/align-systemz.c | 13 | ||||
-rw-r--r-- | clang/test/Driver/systemz-alignment.c | 32 |
2 files changed, 13 insertions, 32 deletions
diff --git a/clang/test/CodeGen/SystemZ/align-systemz.c b/clang/test/CodeGen/SystemZ/align-systemz.c index 5ba4466..9daff6e 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 6f3b2bc..0000000 --- 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; -} |