diff --git a/clang/test/CodeGen/SystemZ/align-systemz.c b/clang/test/CodeGen/SystemZ/align-systemz.c index 5ba446665fef8..9daff6ee97609 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 6f3b2bc38be36..0000000000000 --- 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; -}