blob: 2be149909be5faf380833be3581f0ae40a5ee5a5 [file] [log] [blame]
Eric Christopherb0257342011-07-26 21:42:32 +00001// RUN: %clang_cc1 -emit-llvm %s -o /dev/null
2
3/* In this testcase, the return value of foo() is being promoted to a register
4 * which breaks stuff
5 */
6int printf(const char * restrict format, ...);
7
8union X { char X; void *B; int a, b, c, d;};
9
10union X foo() {
11 union X Global;
12 Global.B = (void*)123; /* Interesting part */
13 return Global;
14}
15
16int main() {
17 union X test = foo();
18 printf("0x%p", test.B);
19}