global-llvm-constant.cpp revision da55074866ca2fe7f718c5d3334648d6e340fb15
1// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
2
3struct A {
4  A() { x = 10; }
5  int x;
6};
7
8const A x;
9
10// CHECK: @_ZL1x = internal global
11
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 };
21