From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../specialized-static-data-mem-init.cpp | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp (limited to 'clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp') diff --git a/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp b/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp new file mode 100644 index 0000000..c2a2ddb --- /dev/null +++ b/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp @@ -0,0 +1,29 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// rdar: // 8562966 +// pr8409 + +// CHECK: @_ZN1CIiE11needs_guardE = weak_odr global +// CHECK: @_ZGVN1CIiE11needs_guardE = weak_odr global + +struct K +{ + K(); + K(const K &); + ~K(); + void PrintNumK(); +}; + +template +struct C +{ + void Go() { needs_guard.PrintNumK(); } + static K needs_guard; +}; + +template K C::needs_guard; + +void F() +{ + C().Go(); +} + -- cgit v1.2.3