llvm-project/llvm/test/FrontendC/2007-05-15-PaddingElement.c

24 lines
290 B
C
Raw Normal View History

2007-05-16 07:44:27 +08:00
// PR 1419
// RUN: %llvmgcc -xc -O2 %s -S -o - | grep "ret i32 1"
2007-05-16 07:44:27 +08:00
struct A {
short x;
long long :0;
};
struct B {
char a;
char b;
unsigned char i;
};
union X { struct A a; struct B b; };
int check(void) {
union X x, y;
y.b.i = 0xff;
x = y;
return (x.b.i == 0xff);
}