Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / 2009-02-13-zerosize-union-field.c
blob8842093b9222377066b4b4b003271a005d98c08a
1 // RUN: %clang_cc1 %s -no-enable-noundef-analysis -triple i686-apple-darwin -emit-llvm -o - | FileCheck %s
2 // Every printf has 'i32 0' for the GEP of the string; no point counting those.
3 typedef unsigned int Foo __attribute__((aligned(32)));
4 typedef union{Foo:0;}a;
5 typedef union{int x; Foo:0;}b;
6 extern int printf(const char*, ...);
7 int main(void) {
8 // CHECK: @.str, i32 0
9 printf("%ld\n", sizeof(a));
10 // CHECK: @.str, i32 1
11 printf("%ld\n", __alignof__(a));
12 // CHECK: @.str, i32 4
13 printf("%ld\n", sizeof(b));
14 // CHECK: @.str, i32 4
15 printf("%ld\n", __alignof__(b));