diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-19 21:54:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-19 21:54:50 +0000 |
commit | d66828daf633bfc74742339ed6e0e214cb6c959e (patch) | |
tree | 259820a9f42def9d1430e59127753a5ddd0c0b5b /clang/test/CodeGenCXX/constructor-attr.cpp | |
parent | 78b9851a3a6f5d26e46576f65b1dc4dc5360aa90 (diff) | |
download | bcm5719-llvm-d66828daf633bfc74742339ed6e0e214cb6c959e.tar.gz bcm5719-llvm-d66828daf633bfc74742339ed6e0e214cb6c959e.zip |
In addition to in-class member functions marked with the "used"
attribute, we also care about those with the "constructor"
attribute. Fixes PR6521.
llvm-svn: 126055
Diffstat (limited to 'clang/test/CodeGenCXX/constructor-attr.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/constructor-attr.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/constructor-attr.cpp b/clang/test/CodeGenCXX/constructor-attr.cpp new file mode 100644 index 00000000000..691795f7761 --- /dev/null +++ b/clang/test/CodeGenCXX/constructor-attr.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s + +// CHECK: @llvm.global_ctors + +// PR6521 +void bar(); +struct Foo { + // CHECK: define linkonce_odr void @_ZN3Foo3fooEv + static void foo() __attribute__((constructor)) { + bar(); + } +}; |