[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / 2002-08-02-UnionTest.c
blob6686e0a63c7d2f0c4728e70cae200b58847eb7c5
1 // RUN: %clang_cc1 -emit-llvm %s -o /dev/null
3 /* In this testcase, the return value of foo() is being promoted to a register
4 * which breaks stuff
5 */
6 int printf(const char * restrict format, ...);
8 union X { char X; void *B; int a, b, c, d;};
10 union X foo(void) {
11 union X Global;
12 Global.B = (void*)123; /* Interesting part */
13 return Global;
16 int main(void) {
17 union X test = foo();
18 printf("0x%p", test.B);