blob: bf20696a22c1ee79c6e38fbca694ff5ec77d88b4 [file] [log] [blame]
Chris Lattner0eea9f92010-04-12 21:10:05 +00001// RUN: %clang_cc1 -emit-llvm %s -o - -triple i686-pc-linux-gnu | FileCheck %s
Eli Friedmanc0879bb2009-08-01 23:11:24 +00002
3// Make sure we generate something sane instead of a ptrtoint
Chris Lattner9cbe4f02011-07-09 17:41:47 +00004// CHECK: bitcast ({ %union.x*, [4 x i8] }* @r to %union.x*), [4 x i8] undef
Eli Friedmanc0879bb2009-08-01 23:11:24 +00005union x {long long b;union x* a;} r = {.a = &r};
Chris Lattner0eea9f92010-04-12 21:10:05 +00006
7
Chris Lattner9cbe4f02011-07-09 17:41:47 +00008// CHECK: global { [3 x i8], [5 x i8] } { [3 x i8] zeroinitializer, [5 x i8] undef }
Nuno Lopescdb30b42010-04-16 20:56:35 +00009union z {
10 char a[3];
11 long long b;
12};
13union z y = {};