Closed
Description
Bugzilla Link | 9593 |
Resolution | FIXED |
Resolved on | Apr 06, 2012 21:42 |
Version | 2.9 |
OS | Windows XP |
Blocks | #8762 llvm/llvm-bugzilla-archive#10152 |
Attachments | foo.s generated by clang -fno-use-cxa-atexit, foo.s generated by cygwin's g++ |
Reporter | LLVM Bugzilla Contributor |
CC | @asl,@rjmccall |
Extended Description
// testcase
extern "C" void ctor();
extern "C" void dtor();
class FOO {
public:
FOO() {ctor();}
~FOO() {dtor();}
};
FOO* get() {
static FOO instance;
return &instance;
}
$ clang++ -cc1 -fno-use-cxa-atexit -O3 -Wall foo.cc -S -emit-llvm -o foo.ll
(snip)
define %class.FOO* @_Z3getv() nounwind {
(check and set guard variable for get()::instance)
}
(snip)
@llvm.global_dtors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__D_a }]
(snip)
define internal void @_GLOBAL__D_a() nounwind {
entry:
tail call void @dtor() nounwind
ret void
}
////////
Cygming is affected by this issue.
FYI, with g++-4.4 on cygming, atexit(tcf_xxx) is used instead of cxa_atexit.