diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-26 06:15:16 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-26 06:15:16 +0000 |
commit | d0c4792ca6bde9d60002760c10eb605ed2eebde8 (patch) | |
tree | 1e896feec2e90d5d031dd1c5e050b5bd1e9fd0b2 /test/CodeGenCXX/anonymous-namespaces.cpp | |
parent | a113e7263c5337731c65fada9de7ff72af25423b (diff) |
If a global variable has an initializer with side effects, it can never be deferred (even if it's in an anonymous namespace).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/anonymous-namespaces.cpp')
-rw-r--r-- | test/CodeGenCXX/anonymous-namespaces.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGenCXX/anonymous-namespaces.cpp b/test/CodeGenCXX/anonymous-namespaces.cpp index 7689c941e1..695f8f59de 100644 --- a/test/CodeGenCXX/anonymous-namespaces.cpp +++ b/test/CodeGenCXX/anonymous-namespaces.cpp @@ -1,9 +1,25 @@ // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s + +int f(); + namespace { + // CHECK: @_ZN12_GLOBAL__N_11bE = internal global i32 0 + // CHECK: @_ZN12_GLOBAL__N_1L1cE = internal global i32 0 + // CHECK: @_ZN12_GLOBAL__N_11D1dE = internal global i32 0 // CHECK: @_ZN12_GLOBAL__N_11aE = internal global i32 0 int a = 0; + int b = f(); + + static int c = f(); + + class D { + static int d; + }; + + int D::d = f(); + // CHECK: define internal i32 @_ZN12_GLOBAL__N_13fooEv() int foo() { return 32; |