diff options
Diffstat (limited to 'clang/test/CodeGenCXX/globalinit-loc.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/globalinit-loc.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/globalinit-loc.cpp b/clang/test/CodeGenCXX/globalinit-loc.cpp new file mode 100644 index 00000000000..bf3340c1572 --- /dev/null +++ b/clang/test/CodeGenCXX/globalinit-loc.cpp @@ -0,0 +1,22 @@ +// 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__I_a +// CHECK-NOT: !dbg +// CHECK: "_GLOBAL__I_a", i32 0, {{.*}}, i32 0} ; [ DW_TAG_subprogram ] [line 0] [local] [def] +# 99 "someheader.h" +class A { +public: + A(); + int foo() { return 0; } +}; +# 5 "main.cpp" +A a; + +int f() { + return a.foo(); +} + |