Skip to content

Commit

Permalink
[SystemZ][z/OS] Add test of leading zero length bitfield in const/vol…
Browse files Browse the repository at this point in the history
…atile struct

Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D99508
  • Loading branch information
fanbo-meng authored and MatteCarra committed Mar 30, 2021
1 parent 5aaa47b commit f5bc9a9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions clang/test/CodeGen/SystemZ/zos-alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f5bc9a9

Please sign in to comment.