| 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)); |
| 16 |
} |