blob: e2b8c3dd401c82673486269644a84205bdcbe6d1 [file] [log] [blame]
Dan Gohmanfea1dd02009-08-25 15:38:29 +00001// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
Tanya Lattnere9af5d12004-11-06 22:41:00 +00002
Chris Lattner20f15aa2002-08-02 16:26:08 +00003/* 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() {
Jeff Cohenb02fbfc2005-04-23 21:26:11 +000011 union X Global;
12 Global.B = (void*)123; /* Interesting part */
13 return Global;
Chris Lattner20f15aa2002-08-02 16:26:08 +000014}
15
Matthijs Kooijmanb7e103b2008-06-10 14:37:44 +000016int main() {
Jeff Cohenb02fbfc2005-04-23 21:26:11 +000017 union X test = foo();
18 printf("0x%p", test.B);
Chris Lattner20f15aa2002-08-02 16:26:08 +000019}