summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/const-init.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-11-12 22:28:03 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-11-12 22:28:03 +0000
commit1bf9a9e6a5bdc0de7939908855dcddf46b661800 (patch)
tree81774dcc4e8eec6cbd2a95cf48e9236a1771bd30 /test/CodeGenCXX/const-init.cpp
parent8213ecaa7ce2048f1e10b02f730aefb7fdda57fe (diff)
Represent an APValue based on a Decl as that Decl, rather than a DeclRefExpr
or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to static member functions and static data members are now emitted as constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/const-init.cpp')
-rw-r--r--test/CodeGenCXX/const-init.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/CodeGenCXX/const-init.cpp b/test/CodeGenCXX/const-init.cpp
index f06e546ec9..1fc3deba41 100644
--- a/test/CodeGenCXX/const-init.cpp
+++ b/test/CodeGenCXX/const-init.cpp
@@ -29,12 +29,17 @@ namespace test2 {
struct A {
static const double d = 1.0;
static const float f = d / 2;
- };
+ static int g();
+ } a;
// CHECK: @_ZN5test22t0E = global double {{1\.0+e\+0+}}, align 8
// CHECK: @_ZN5test22t1E = global [2 x double] [double {{1\.0+e\+0+}}, double {{5\.0+e-0*}}1], align 16
+ // CHECK: @_ZN5test22t2E = global double* @_ZN5test21A1d
+ // CHECK: @_ZN5test22t3E = global {{.*}} @_ZN5test21A1g
double t0 = A::d;
double t1[] = { A::d, A::f };
+ const double *t2 = &a.d;
+ int (*t3)() = &a.g;
}
// We don't expect to fold this in the frontend, but make sure it doesn't crash.