From 605fa8fe517b573fc9add520dbf4a014bc52e2fe Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 8 Jun 2010 22:48:02 +0000 Subject: [PATCH] Add test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105651 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenCXX/global-init-darwin.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/CodeGenCXX/global-init-darwin.cpp diff --git a/test/CodeGenCXX/global-init-darwin.cpp b/test/CodeGenCXX/global-init-darwin.cpp new file mode 100644 index 0000000000..37ddfeab06 --- /dev/null +++ b/test/CodeGenCXX/global-init-darwin.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -triple=x86_64-apple-darwin10 -emit-llvm %s -o - |FileCheck %s + +struct A { + A(); + ~A(); +}; + +A a; +A as[2]; + +struct B { + B(); + ~B(); + int f(); +}; + +int i = B().f(); + +// CHECK: define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { +// CHECK: define internal void @__cxx_global_var_init1() section "__TEXT,__StaticInit,regular,pure_instructions" { +// CHECK: define internal void @__cxx_global_array_dtor(i8*) section "__TEXT,__StaticInit,regular,pure_instructions" { +// CHECK: define internal void @__cxx_global_var_init2() section "__TEXT,__StaticInit,regular,pure_instructions" { +// CHECK: define internal void @_GLOBAL__I_a() section "__TEXT,__StaticInit,regular,pure_instructions" {