diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
| commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
| tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/CodeGenCXX/const-init-cxx11.cpp | |
| parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/const-init-cxx11.cpp')
| -rw-r--r-- | test/CodeGenCXX/const-init-cxx11.cpp | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp index d21e91178e40..f671e0ad8802 100644 --- a/test/CodeGenCXX/const-init-cxx11.cpp +++ b/test/CodeGenCXX/const-init-cxx11.cpp @@ -382,17 +382,22 @@ namespace ArrayTemporary { namespace UnemittedTemporaryDecl { constexpr int &&ref = 0; extern constexpr int &ref2 = ref; - // CHECK: @_ZGRN22UnemittedTemporaryDecl3refE = private global i32 0 + // CHECK: @_ZGRN22UnemittedTemporaryDecl3refE_ = private global i32 0 // FIXME: This declaration should not be emitted -- it isn't odr-used. // CHECK: @_ZN22UnemittedTemporaryDecl3refE - // CHECK: @_ZN22UnemittedTemporaryDecl4ref2E = constant i32* @_ZGRN22UnemittedTemporaryDecl3refE + // CHECK: @_ZN22UnemittedTemporaryDecl4ref2E = constant i32* @_ZGRN22UnemittedTemporaryDecl3refE_ } // CHECK: @_ZZN12LocalVarInit3aggEvE1a = internal constant {{.*}} i32 101 // CHECK: @_ZZN12LocalVarInit4ctorEvE1a = internal constant {{.*}} i32 102 // CHECK: @_ZZN12LocalVarInit8mutable_EvE1a = private unnamed_addr constant {{.*}} i32 103 +// CHECK: @_ZGRN33ClassTemplateWithStaticDataMember1SIvE1aE_ = linkonce_odr constant i32 5 +// CHECK: @_ZN33ClassTemplateWithStaticDataMember3useE = constant i32* @_ZGRN33ClassTemplateWithStaticDataMember1SIvE1aE_ +// CHECK: @_ZGRN39ClassTemplateWithHiddenStaticDataMember1SIvE1aE_ = linkonce_odr hidden constant i32 5 +// CHECK: @_ZN39ClassTemplateWithHiddenStaticDataMember3useE = constant i32* @_ZGRN39ClassTemplateWithHiddenStaticDataMember1SIvE1aE_ +// CHECK: @_ZGRZN20InlineStaticConstRef3funEvE1i_ = linkonce_odr constant i32 10 // Constant initialization tests go before this point, // dynamic initialization tests go after. @@ -527,10 +532,10 @@ namespace InitFromConst { // CHECK: call void @_ZN13InitFromConst7consumeIdEEvT_(double 4.300000e+00) consume(d); - // CHECK: call void @_ZN13InitFromConst7consumeIRKNS_1SEEEvT_(%"struct.InitFromConst::S"* @_ZN13InitFromConstL1sE) + // CHECK: call void @_ZN13InitFromConst7consumeIRKNS_1SEEEvT_(%"struct.InitFromConst::S"* dereferenceable({{[0-9]+}}) @_ZN13InitFromConstL1sE) consume<const S&>(s); - // CHECK: call void @_ZN13InitFromConst7consumeIRKNS_1SEEEvT_(%"struct.InitFromConst::S"* @_ZN13InitFromConstL1sE) + // CHECK: call void @_ZN13InitFromConst7consumeIRKNS_1SEEEvT_(%"struct.InitFromConst::S"* dereferenceable({{[0-9]+}}) @_ZN13InitFromConstL1sE) consume<const S&>(r); // CHECK: call void @_ZN13InitFromConst7consumeIPKNS_1SEEEvT_(%"struct.InitFromConst::S"* @_ZN13InitFromConstL1sE) @@ -552,3 +557,32 @@ namespace Null { // CHECK: call {{.*}} @_ZN4Null4nullEv( int S::*q = null(); } + +namespace InlineStaticConstRef { + inline const int &fun() { + static const int &i = 10; + return i; + // CHECK: ret i32* @_ZGRZN20InlineStaticConstRef3funEvE1i_ + } + const int &use = fun(); +} + +namespace ClassTemplateWithStaticDataMember { + template <typename T> + struct S { + static const int &a; + }; + template <typename T> + const int &S<T>::a = 5; + const int &use = S<void>::a; +} + +namespace ClassTemplateWithHiddenStaticDataMember { + template <typename T> + struct S { + __attribute__((visibility("hidden"))) static const int &a; + }; + template <typename T> + const int &S<T>::a = 5; + const int &use = S<void>::a; +} |
