[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / CodeGenCXX / arm64-generated-fn-attr.cpp
blob18d9da40d469bd1442737eab60c9e2f9781ceced
1 // RUN: %clang_cc1 -triple aarch64 -mbranch-target-enforce -msign-return-address=all -fcxx-exceptions -fexceptions -emit-llvm %s -o - | FileCheck %s
3 // Check that functions generated by clang have the correct attributes
5 class Example {
6 public:
7 Example();
8 int fn();
9 };
11 // Initialization of var1 causes __cxx_global_var_init and __tls_init to be generated
12 thread_local Example var1;
13 extern thread_local Example var2;
14 extern void fn();
16 int testfn() noexcept {
17 // Calling fn in a noexcept function causes __clang_call_terminate to be generated
18 fn();
19 // Use of var1 and var2 causes TLS wrapper functions to be generated
20 return var1.fn() + var2.fn();
23 // CHECK: define {{.*}} @__cxx_global_var_init() [[ATTR1:#[0-9]+]]
24 // CHECK: define {{.*}} @__clang_call_terminate({{.*}}) [[ATTR2:#[0-9]+]]
25 // CHECK: define {{.*}} @_ZTW4var1() [[ATTR1]]
26 // CHECK: define {{.*}} @_ZTW4var2() [[ATTR1]]
27 // CHECK: define {{.*}} @__tls_init() [[ATTR1]]
29 // CHECK: attributes [[ATTR1]] = { {{.*}}"branch-target-enforcement" {{.*}}"sign-return-address"="all" "sign-return-address-key"="a_key"
30 // CHECK: attributes [[ATTR2]] = { {{.*}}"branch-target-enforcement" {{.*}}"sign-return-address"="all" "sign-return-address-key"="a_key"