2014-01-15 03:35:09 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
|
2009-12-12 05:23:03 +08:00
|
|
|
|
|
|
|
struct A {
|
|
|
|
A() { x = 10; }
|
|
|
|
int x;
|
|
|
|
};
|
|
|
|
|
|
|
|
const A x;
|
|
|
|
|
2010-01-24 11:04:27 +08:00
|
|
|
// CHECK: @_ZL1x = internal global
|
2011-05-08 06:06:45 +08:00
|
|
|
|
|
|
|
struct X {
|
|
|
|
int (*fp)(int, int);
|
|
|
|
};
|
|
|
|
|
|
|
|
int add(int x, int y) { return x + y; }
|
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK: @x2 = {{(dso_local )?}}constant
|
2011-05-08 06:06:45 +08:00
|
|
|
extern const X x2;
|
|
|
|
const X x2 = { &add };
|
2011-05-13 09:05:07 +08:00
|
|
|
|
|
|
|
struct X1 {
|
|
|
|
mutable int i;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct X2 {
|
|
|
|
X1 array[3];
|
|
|
|
};
|
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK: @x2b = {{(dso_local )?}}global
|
2011-05-13 09:05:07 +08:00
|
|
|
extern const X2 x2b;
|
|
|
|
const X2 x2b = { { { 1 }, { 2 }, { 3 } } };
|