[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / CodeGenCXX / fmv-namespace.cpp
blob75f29e1c779759f248c47e560198dba51304e791
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --include-generated-funcs --global-value-regex ".*" --version 5
2 // RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-llvm %s -o - | FileCheck %s
4 namespace Name {
5 int __attribute((target_version("default"))) foo() { return 0; }
8 namespace Name {
9 int __attribute((target_version("sve"))) foo() { return 1; }
12 int bar() { return Name::foo(); }
14 namespace OtherName {
15 int __attribute((target_version("sve"))) foo() { return 2; }
18 int baz() { return OtherName::foo(); }
20 namespace Foo {
21 int bar();
22 __attribute((target_version("default"))) int bar() { return 0; }
23 __attribute((target_version("mops"))) int bar() { return 1; }
26 //.
27 // CHECK: @__aarch64_cpu_features = external dso_local global { i64 }
28 // CHECK: @_ZN4Name3fooEv = weak_odr ifunc i32 (), ptr @_ZN4Name3fooEv.resolver
29 // CHECK: @_ZN3Foo3barEv = weak_odr ifunc i32 (), ptr @_ZN3Foo3barEv.resolver
30 //.
31 // CHECK-LABEL: define dso_local noundef i32 @_ZN4Name3fooEv.default(
32 // CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
33 // CHECK-NEXT: [[ENTRY:.*:]]
34 // CHECK-NEXT: ret i32 0
37 // CHECK-LABEL: define dso_local noundef i32 @_ZN4Name3fooEv._Msve(
38 // CHECK-SAME: ) #[[ATTR1:[0-9]+]] {
39 // CHECK-NEXT: [[ENTRY:.*:]]
40 // CHECK-NEXT: ret i32 1
43 // CHECK-LABEL: define dso_local noundef i32 @_Z3barv(
44 // CHECK-SAME: ) #[[ATTR2:[0-9]+]] {
45 // CHECK-NEXT: [[ENTRY:.*:]]
46 // CHECK-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN4Name3fooEv()
47 // CHECK-NEXT: ret i32 [[CALL]]
50 // CHECK-LABEL: define dso_local noundef i32 @_ZN9OtherName3fooEv._Msve(
51 // CHECK-SAME: ) #[[ATTR1]] {
52 // CHECK-NEXT: [[ENTRY:.*:]]
53 // CHECK-NEXT: ret i32 2
56 // CHECK-LABEL: define dso_local noundef i32 @_Z3bazv(
57 // CHECK-SAME: ) #[[ATTR2]] {
58 // CHECK-NEXT: [[ENTRY:.*:]]
59 // CHECK-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN9OtherName3fooEv()
60 // CHECK-NEXT: ret i32 [[CALL]]
63 // CHECK-LABEL: define dso_local noundef i32 @_ZN3Foo3barEv.default(
64 // CHECK-SAME: ) #[[ATTR0]] {
65 // CHECK-NEXT: [[ENTRY:.*:]]
66 // CHECK-NEXT: ret i32 0
69 // CHECK-LABEL: define dso_local noundef i32 @_ZN3Foo3barEv._Mmops(
70 // CHECK-SAME: ) #[[ATTR4:[0-9]+]] {
71 // CHECK-NEXT: [[ENTRY:.*:]]
72 // CHECK-NEXT: ret i32 1
75 // CHECK-LABEL: define weak_odr ptr @_ZN4Name3fooEv.resolver() comdat {
76 // CHECK-NEXT: [[RESOLVER_ENTRY:.*:]]
77 // CHECK-NEXT: call void @__init_cpu_features_resolver()
78 // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
79 // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 1073807616
80 // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 1073807616
81 // CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
82 // CHECK-NEXT: br i1 [[TMP3]], label %[[RESOLVER_RETURN:.*]], label %[[RESOLVER_ELSE:.*]]
83 // CHECK: [[RESOLVER_RETURN]]:
84 // CHECK-NEXT: ret ptr @_ZN4Name3fooEv._Msve
85 // CHECK: [[RESOLVER_ELSE]]:
86 // CHECK-NEXT: ret ptr @_ZN4Name3fooEv.default
89 // CHECK-LABEL: define weak_odr ptr @_ZN3Foo3barEv.resolver() comdat {
90 // CHECK-NEXT: [[RESOLVER_ENTRY:.*:]]
91 // CHECK-NEXT: call void @__init_cpu_features_resolver()
92 // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
93 // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 576460752303423488
94 // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 576460752303423488
95 // CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
96 // CHECK-NEXT: br i1 [[TMP3]], label %[[RESOLVER_RETURN:.*]], label %[[RESOLVER_ELSE:.*]]
97 // CHECK: [[RESOLVER_RETURN]]:
98 // CHECK-NEXT: ret ptr @_ZN3Foo3barEv._Mmops
99 // CHECK: [[RESOLVER_ELSE]]:
100 // CHECK-NEXT: ret ptr @_ZN3Foo3barEv.default
103 // CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
104 // CHECK: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}