xref: /llvm-project/clang/test/CodeGen/2009-12-07-BitFieldAlignment.c (revision 85e5156598b1bbad0ae41cf4d0d5b845dd655ffd)
1*85e51565SEric Christopher // RUN: %clang_cc1 -triple i686-apple-darwin %s -emit-llvm -o - | FileCheck %s
2*85e51565SEric Christopher // Set alignment on bitfield accesses.
3*85e51565SEric Christopher 
4*85e51565SEric Christopher struct S {
5*85e51565SEric Christopher   int a, b;
6*85e51565SEric Christopher   void *c;
7*85e51565SEric Christopher   unsigned d : 8;
8*85e51565SEric Christopher   unsigned e : 8;
9*85e51565SEric Christopher };
10*85e51565SEric Christopher 
f0(struct S * a)11*85e51565SEric Christopher void f0(struct S *a) {
12*85e51565SEric Christopher // CHECK: load {{.*}}, align 4
13*85e51565SEric Christopher // CHECK: store {{.*}}, align 4
14*85e51565SEric Christopher   a->e = 0;
15*85e51565SEric Christopher }
16