diff options
Diffstat (limited to 'test/CodeGenCXX/globalinit-loc.cpp')
-rw-r--r-- | test/CodeGenCXX/globalinit-loc.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/CodeGenCXX/globalinit-loc.cpp b/test/CodeGenCXX/globalinit-loc.cpp new file mode 100644 index 000000000000..eb39aec94d48 --- /dev/null +++ b/test/CodeGenCXX/globalinit-loc.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s +// rdar://problem/14985269. +// +// Verify that the global init helper function does not get associated +// with any source location. +// +// CHECK: define internal void @_GLOBAL__sub_I_globalinit_loc.cpp +// CHECK: !dbg ![[DBG:.*]] +// CHECK: "_GLOBAL__sub_I_globalinit_loc.cpp", i32 0, {{.*}}, i32 0} ; [ DW_TAG_subprogram ] [line 0] [local] [def] +// CHECK: ![[DBG]] = metadata !{i32 0, i32 0, +# 99 "someheader.h" +class A { +public: + A(); + int foo() { return 0; } +}; +# 5 "main.cpp" +A a; + +int f() { + return a.foo(); +} + |