diff --git a/clang/test/AST/alignas_maybe_odr_cleanup.cpp b/clang/test/AST/alignas_maybe_odr_cleanup.cpp --- a/clang/test/AST/alignas_maybe_odr_cleanup.cpp +++ b/clang/test/AST/alignas_maybe_odr_cleanup.cpp @@ -8,7 +8,7 @@ // RUN: | FileCheck %s struct FOO { - static const int vec_align_bytes = 32; + static const int vec_align_bytes = 16; void foo() { double a alignas(vec_align_bytes); ; @@ -17,7 +17,7 @@ // CHECK: | `-AlignedAttr {{.*}} alignas // CHECK-NEXT: | `-ConstantExpr {{.*}} 'int' -// CHECK-NEXT: | |-value: Int 32 +// CHECK-NEXT: | |-value: Int 16 // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} 'int' // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'const int' lvalue Var {{.*}} 'vec_align_bytes' 'const int' non_odr_use_constant // CHECK-NEXT: `-NullStmt {{.*}} diff --git a/clang/test/CodeGen/PR5060-align.c b/clang/test/CodeGen/PR5060-align.c --- a/clang/test/CodeGen/PR5060-align.c +++ b/clang/test/CodeGen/PR5060-align.c @@ -1,13 +1,13 @@ // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s -// CHECK: @foo.p = internal global i8 0, align 32 +// CHECK: @foo.p = internal global i8 0, align 16 char *foo(void) { - static char p __attribute__((aligned(32))); + static char p __attribute__((aligned(16))); return &p; } void bar(long n) { - // CHECK: align 32 - char p[n] __attribute__((aligned(32))); + // CHECK: align 16 + char p[n] __attribute__((aligned(16))); } diff --git a/clang/test/Layout/itanium-union-bitfield.cpp b/clang/test/Layout/itanium-union-bitfield.cpp --- a/clang/test/Layout/itanium-union-bitfield.cpp +++ b/clang/test/Layout/itanium-union-bitfield.cpp @@ -1,15 +1,23 @@ // RUN: %clang_cc1 -emit-llvm-only -triple %itanium_abi_triple -fdump-record-layouts %s 2>/dev/null \ // RUN: | FileCheck %s +// On z/OS, a bit-field has single byte alignment. Add aligned(4) on z/OS so the union has +// the same size & alignment as expected. +#ifdef __MVS__ +#define ALIGN4 __attribute__((aligned(4))) +#else +#define ALIGN4 +#endif + union A { - int f1: 3; + int f1 : 3 ALIGN4; A(); }; A::A() {} union B { - char f1: 35; + char f1 : 35 ALIGN4; B(); };