1*67e74705SXin Li // RUN: %clang_cc1 %s -triple i686-apple-darwin -emit-llvm -o - | FileCheck %s
2*67e74705SXin Li // Every printf has 'i32 0' for the GEP of the string; no point counting those.
3*67e74705SXin Li typedef unsigned int Foo __attribute__((aligned(32)));
4*67e74705SXin Li typedef union{Foo:0;}a;
5*67e74705SXin Li typedef union{int x; Foo:0;}b;
6*67e74705SXin Li extern int printf(const char*, ...);
main()7*67e74705SXin Li int main() {
8*67e74705SXin Li // CHECK: getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 0
9*67e74705SXin Li printf("%ld\n", sizeof(a));
10*67e74705SXin Li // CHECK: getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 1
11*67e74705SXin Li printf("%ld\n", __alignof__(a));
12*67e74705SXin Li // CHECK: getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 4
13*67e74705SXin Li printf("%ld\n", sizeof(b));
14*67e74705SXin Li // CHECK: getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 4
15*67e74705SXin Li printf("%ld\n", __alignof__(b));
16*67e74705SXin Li }
17