freebsd-dev/test/CodeGenCXX/const-init.cpp

27 lines
473 B
C++
Raw Normal View History

2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
2009-06-02 17:58:47 +00:00
2009-12-01 11:08:04 +00:00
// CHECK: @a = global i32 10
2009-06-02 17:58:47 +00:00
int a = 10;
2010-02-16 09:31:36 +00:00
// CHECK: @ar = constant i32* @a
2009-06-02 17:58:47 +00:00
int &ar = a;
void f();
2010-02-16 09:31:36 +00:00
// CHECK: @fr = constant void ()* @_Z1fv
2009-06-02 17:58:47 +00:00
void (&fr)() = f;
struct S { int& a; };
2009-12-01 11:08:04 +00:00
// CHECK: @s = global %0 { i32* @a }
2009-06-02 17:58:47 +00:00
S s = { a };
2009-12-01 11:08:04 +00:00
// PR5581
namespace PR5581 {
class C {
public:
enum { e0, e1 };
unsigned f;
};
// CHECK: @_ZN6PR55812g0E = global %1 { i32 1 }
C g0 = { C::e1 };
}