blob: e2b8c3dd401c82673486269644a84205bdcbe6d1 [file] [log] [blame]
Dan Gohman2d65d352009-08-25 15:38:29 +00001// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
3/* In this testcase, the return value of foo() is being promotedto a register
4 * which breaks stuff
5 */
6#include <stdio.h>
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
Matthijs Kooijmanb0bf82d2008-06-10 14:37:44 +000016int main() {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000017 union X test = foo();
18 printf("0x%p", test.B);
19}