diff options
author | John McCall <rjmccall@apple.com> | 2010-10-09 01:34:31 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-09 01:34:31 +0000 |
commit | 189d6ef40eff11b83b2cda941d5ed89a5cef09b2 (patch) | |
tree | b3ed268c2a51e3b69a2da8173a7de925861ed445 /test/CodeGenCXX/const-init.cpp | |
parent | 59705aee3fe01aa6fb6962dd11350161b47983d9 (diff) |
Permit constant evaluation of const floating-point variables with
constant initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/const-init.cpp')
-rw-r--r-- | test/CodeGenCXX/const-init.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGenCXX/const-init.cpp b/test/CodeGenCXX/const-init.cpp index 9cfce7ace8..d206b64951 100644 --- a/test/CodeGenCXX/const-init.cpp +++ b/test/CodeGenCXX/const-init.cpp @@ -24,3 +24,15 @@ public: // CHECK: @_ZN6PR55812g0E = global %1 { i32 1 } C g0 = { C::e1 }; } + +namespace test2 { + struct A { + static const double d = 1.0; + static const float f = d / 2; + }; + + // CHECK: @_ZN5test22t0E = global double 1.000000e+00, align 8 + // CHECK: @_ZN5test22t1E = global [2 x double] [double 1.000000e+00, double 5.000000e-01], align 16 + double t0 = A::d; + double t1[] = { A::d, A::f }; +} |