Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | // RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null |
2 | |||||
3 | /* In this testcase, the return value of foo() is being promotedto a register | ||||
4 | * which breaks stuff | ||||
5 | */ | ||||
6 | #include <stdio.h> | ||||
7 | |||||
8 | union X { char X; void *B; int a, b, c, d;}; | ||||
9 | |||||
10 | union X foo() { | ||||
11 | union X Global; | ||||
12 | Global.B = (void*)123; /* Interesting part */ | ||||
13 | return Global; | ||||
14 | } | ||||
15 | |||||
16 | void main() { | ||||
17 | union X test = foo(); | ||||
18 | printf("0x%p", test.B); | ||||
19 | } |