llvm-project/clang/test/CodeGenCXX/globalinit-loc.cpp
Adrian Prantl 0ce2b87507 Follow-up to r205999: Emit an artificial location (valid scope, line 0)
for CXXGlobalInit/Dtor helper functions.
This makes _GLOBAL__I_a regain its DW_AT_high/low_pc in the debug info.

Thanks to echristo for catching this!

llvm-svn: 206088
2014-04-11 23:45:01 +00:00

24 lines
529 B
C++

// 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: !dbg ![[DBG:.*]]
// CHECK: "_GLOBAL__I_a", 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();
}