blob: 55933eecfc3ee38a9a192c30a5a632571feb086b [file] [log] [blame]
Stephen Hines651f13c2014-04-23 16:59:28 -07001// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
Eli Friedman20e098b2009-12-11 21:23:03 +00002
3struct A {
4 A() { x = 10; }
5 int x;
6};
7
8const A x;
9
Sean Hunt31455252010-01-24 03:04:27 +000010// CHECK: @_ZL1x = internal global
Douglas Gregorda550742011-05-07 22:06:45 +000011
12struct X {
13 int (*fp)(int, int);
14};
15
16int add(int x, int y) { return x + y; }
17
18// CHECK: @x2 = constant
19extern const X x2;
20const X x2 = { &add };
Douglas Gregor2bb11012011-05-13 01:05:07 +000021
22struct X1 {
23 mutable int i;
24};
25
26struct X2 {
27 X1 array[3];
28};
29
30// CHECK: @x2b = global
31extern const X2 x2b;
32const X2 x2b = { { { 1 }, { 2 }, { 3 } } };