[analyzer] Refactoring: Drop the 'GR' prefix.
[clang.git] / test / CodeGenCXX / const-init.cpp
bloba8c6f304980b6ddeee3c8d7802094ec01dfeaaba
1 // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
3 // CHECK: @a = global i32 10
4 int a = 10;
5 // CHECK: @ar = constant i32* @a
6 int &ar = a;
8 void f();
9 // CHECK: @fr = constant void ()* @_Z1fv
10 void (&fr)() = f;
12 struct S { int& a; };
13 // CHECK: @s = global %0 { i32* @a }
14 S s = { a };
16 // PR5581
17 namespace PR5581 {
18 class C {
19 public:
20 enum { e0, e1 };
21 unsigned f;
24 // CHECK: @_ZN6PR55812g0E = global %1 { i32 1 }
25 C g0 = { C::e1 };
28 namespace test2 {
29 struct A {
30 static const double d = 1.0;
31 static const float f = d / 2;
34 // CHECK: @_ZN5test22t0E = global double {{1\.0+e\+0+}}, align 8
35 // CHECK: @_ZN5test22t1E = global [2 x double] [double {{1\.0+e\+0+}}, double {{5\.0+e-0*}}1], align 16
36 double t0 = A::d;
37 double t1[] = { A::d, A::f };