Files
clang-p2996/clang/test/CodeGenCXX/deferred-global-init.cpp
Alexis Hunt aecc45cb3c Mangle static variables with an extra name to distinguish them from non-static variables in the same TU.
Fixes PR5966 for real this time; also reverts r92911, which had a incorrect fix.

llvm-svn: 94352
2010-01-24 03:04:27 +00:00

17 lines
405 B
C++

// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// PR5967
extern void* foo;
static void* const a = foo;
void* bar() { return a; }
// CHECK: @_ZL1a = internal global i8* null
// CHECK: define internal void @__cxx_global_var_init
// CHECK: load i8** @foo
// CHECK: ret void
// CHECK: define internal void @__cxx_global_initialization
// CHECK: call void @__cxx_global_var_init()
// CHECK: ret void