Debian Codegraph @

clang/test/CodeGenCXX/constructor-attr.cpp

raw
1 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
2
3 // CHECK: @llvm.global_ctors
4 // CHECK-SAME: i32 65535, ptr @_ZN3Foo3fooEv
5 // CHECK-SAME: i32 101, ptr @_Z22template_dependent_cxxILi101EEvv
6 // CHECK-SAME: i32 102, ptr @_Z22template_dependent_gnuILi102EEvv
7 // CHECK-SAME: i32 103, ptr @_Z1fv
8 // CHECK-SAME: i32 104, ptr @_Z23template_dependent_nttpIiLi104EEvv
9
10 // PR6521
11 void bar();
12 struct Foo {
13 // CHECK-LABEL: define linkonce_odr {{.*}}void @_ZN3Foo3fooEv
14 static void foo() __attribute__((constructor)) {
15 bar();
16 }
17 };
18
19
20 template <int P>
21 [[gnu::constructor(P)]] void template_dependent_cxx() {}
22 template <int P>
23 __attribute__((constructor(P))) void template_dependent_gnu() {}
24 template <typename T, int P = sizeof(T) * 26>
25 [[gnu::constructor(P)]] void template_dependent_nttp() {}
26
27 template void template_dependent_cxx<101>();
28 template void template_dependent_gnu<102>();
29 [[gnu::constructor(103)]] void f() {}
30 template void template_dependent_nttp<int>();