From f1e0c7fdd72026f62e2c38ee249705fbb9213a30 Mon Sep 17 00:00:00 2001 From: Fanbo Meng Date: Mon, 29 Mar 2021 12:06:12 -0400 Subject: [PATCH] [SystemZ][z/OS] Add test of leading zero length bitfield in const/volatile struct Reviewed By: abhina.sreeskantharajan Differential Revision: https://reviews.llvm.org/D99508 --- clang/test/CodeGen/SystemZ/zos-alignment.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/clang/test/CodeGen/SystemZ/zos-alignment.c b/clang/test/CodeGen/SystemZ/zos-alignment.c index 9371a54..b439684 100644 --- a/clang/test/CodeGen/SystemZ/zos-alignment.c +++ b/clang/test/CodeGen/SystemZ/zos-alignment.c @@ -12,6 +12,24 @@ int f0() { return v0 + v1 + v2 + v3; } // DECL-NEXT: @v2 {{.*}} align 16 // DECL-NEXT: @v3 {{.*}} align 32 +const struct cs0 { + unsigned long :0; + long long a; +} CS0 = {}; +// CHECK: 0 | struct cs0 +// CHECK-NEXT: 0:- | unsigned long +// CHECK-NEXT: 0 | long long a +// CHECK-NEXT: | [sizeof=8, align=8] + +volatile struct vs0 { + long :0; + short a; +} VS0; +// CHECK: 0 | struct vs0 +// CHECK-NEXT: 0:- | long +// CHECK-NEXT: 0 | short a +// CHECK-NEXT: | [sizeof=2, align=2] + struct s0 { short a:3; long b:5; -- 2.7.4