Chris Lattner | 0eea9f9 | 2010-04-12 21:10:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm %s -o - -triple i686-pc-linux-gnu | FileCheck %s |
Eli Friedman | c0879bb | 2009-08-01 23:11:24 +0000 | [diff] [blame] | 2 | |
| 3 | // Make sure we generate something sane instead of a ptrtoint |
Chris Lattner | 9cbe4f0 | 2011-07-09 17:41:47 +0000 | [diff] [blame] | 4 | // CHECK: bitcast ({ %union.x*, [4 x i8] }* @r to %union.x*), [4 x i8] undef |
Eli Friedman | c0879bb | 2009-08-01 23:11:24 +0000 | [diff] [blame] | 5 | union x {long long b;union x* a;} r = {.a = &r}; |
Chris Lattner | 0eea9f9 | 2010-04-12 21:10:05 +0000 | [diff] [blame] | 6 | |
| 7 | |
Chris Lattner | 9cbe4f0 | 2011-07-09 17:41:47 +0000 | [diff] [blame] | 8 | // CHECK: global { [3 x i8], [5 x i8] } { [3 x i8] zeroinitializer, [5 x i8] undef } |
Nuno Lopes | cdb30b4 | 2010-04-16 20:56:35 +0000 | [diff] [blame] | 9 | union z { |
| 10 | char a[3]; |
| 11 | long long b; |
| 12 | }; |
| 13 | union z y = {}; |