| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals --include-generated-funcs --global-value-regex ".*" |
| 2 |
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -emit-llvm -o - %s | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature -fmv -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-NOFMV |
| 4 |
|
| 5 |
int implicit_default_decl_first(void); |
| 6 |
__attribute__((target_version("default"))) int implicit_default_decl_first(void) { return 1; } |
| 7 |
int caller1(void) { return implicit_default_decl_first(); } |
| 8 |
|
| 9 |
__attribute__((target_version("default"))) int explicit_default_def_first(void) { return 2; } |
| 10 |
int explicit_default_def_first(void); |
| 11 |
int caller2(void) { return explicit_default_def_first(); } |
| 12 |
|
| 13 |
int implicit_default_def_first(void) { return 3; } |
| 14 |
__attribute__((target_version("default"))) int implicit_default_def_first(void); |
| 15 |
int caller3(void) { return implicit_default_def_first(); } |
| 16 |
|
| 17 |
__attribute__((target_version("default"))) int explicit_default_decl_first(void); |
| 18 |
int explicit_default_decl_first(void) { return 4; } |
| 19 |
int caller4(void) { return explicit_default_decl_first(); } |
| 20 |
|
| 21 |
int no_def_implicit_default_first(void); |
| 22 |
__attribute__((target_version("default"))) int no_def_implicit_default_first(void); |
| 23 |
int caller5(void) { return no_def_implicit_default_first(); } |
| 24 |
|
| 25 |
__attribute__((target_version("default"))) int no_def_explicit_default_first(void); |
| 26 |
int no_def_explicit_default_first(void); |
| 27 |
int caller6(void) { return no_def_explicit_default_first(); } |
| 28 |
//. |
| 29 |
// CHECK: @implicit_default_decl_first = weak_odr ifunc i32 (), ptr @implicit_default_decl_first.resolver |
| 30 |
// CHECK: @explicit_default_def_first = weak_odr ifunc i32 (), ptr @explicit_default_def_first.resolver |
| 31 |
// CHECK: @implicit_default_def_first = weak_odr ifunc i32 (), ptr @implicit_default_def_first.resolver |
| 32 |
// CHECK: @explicit_default_decl_first = weak_odr ifunc i32 (), ptr @explicit_default_decl_first.resolver |
| 33 |
//. |
| 34 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 35 |
// CHECK-LABEL: define {{[^@]+}}@implicit_default_decl_first.default |
| 36 |
// CHECK-SAME: () #[[ATTR0:[0-9]+]] { |
| 37 |
// CHECK-NEXT: entry: |
| 38 |
// CHECK-NEXT: ret i32 1 |
| 39 |
// |
| 40 |
// |
| 41 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 42 |
// CHECK-LABEL: define {{[^@]+}}@caller1 |
| 43 |
// CHECK-SAME: () #[[ATTR1:[0-9]+]] { |
| 44 |
// CHECK-NEXT: entry: |
| 45 |
// CHECK-NEXT: [[CALL:%.*]] = call i32 @implicit_default_decl_first() |
| 46 |
// CHECK-NEXT: ret i32 [[CALL]] |
| 47 |
// |
| 48 |
// |
| 49 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 50 |
// CHECK-LABEL: define {{[^@]+}}@explicit_default_def_first.default |
| 51 |
// CHECK-SAME: () #[[ATTR0]] { |
| 52 |
// CHECK-NEXT: entry: |
| 53 |
// CHECK-NEXT: ret i32 2 |
| 54 |
// |
| 55 |
// |
| 56 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 57 |
// CHECK-LABEL: define {{[^@]+}}@caller2 |
| 58 |
// CHECK-SAME: () #[[ATTR1]] { |
| 59 |
// CHECK-NEXT: entry: |
| 60 |
// CHECK-NEXT: [[CALL:%.*]] = call i32 @explicit_default_def_first() |
| 61 |
// CHECK-NEXT: ret i32 [[CALL]] |
| 62 |
// |
| 63 |
// |
| 64 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 65 |
// CHECK-LABEL: define {{[^@]+}}@implicit_default_def_first.default |
| 66 |
// CHECK-SAME: () #[[ATTR1]] { |
| 67 |
// CHECK-NEXT: entry: |
| 68 |
// CHECK-NEXT: ret i32 3 |
| 69 |
// |
| 70 |
// |
| 71 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 72 |
// CHECK-LABEL: define {{[^@]+}}@caller3 |
| 73 |
// CHECK-SAME: () #[[ATTR1]] { |
| 74 |
// CHECK-NEXT: entry: |
| 75 |
// CHECK-NEXT: [[CALL:%.*]] = call i32 @implicit_default_def_first() |
| 76 |
// CHECK-NEXT: ret i32 [[CALL]] |
| 77 |
// |
| 78 |
// |
| 79 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 80 |
// CHECK-LABEL: define {{[^@]+}}@explicit_default_decl_first.default |
| 81 |
// CHECK-SAME: () #[[ATTR0]] { |
| 82 |
// CHECK-NEXT: entry: |
| 83 |
// CHECK-NEXT: ret i32 4 |
| 84 |
// |
| 85 |
// |
| 86 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 87 |
// CHECK-LABEL: define {{[^@]+}}@caller4 |
| 88 |
// CHECK-SAME: () #[[ATTR1]] { |
| 89 |
// CHECK-NEXT: entry: |
| 90 |
// CHECK-NEXT: [[CALL:%.*]] = call i32 @explicit_default_decl_first() |
| 91 |
// CHECK-NEXT: ret i32 [[CALL]] |
| 92 |
// |
| 93 |
// |
| 94 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 95 |
// CHECK-LABEL: define {{[^@]+}}@caller5 |
| 96 |
// CHECK-SAME: () #[[ATTR1]] { |
| 97 |
// CHECK-NEXT: entry: |
| 98 |
// CHECK-NEXT: [[CALL:%.*]] = call i32 @no_def_implicit_default_first() |
| 99 |
// CHECK-NEXT: ret i32 [[CALL]] |
| 100 |
// |
| 101 |
// |
| 102 |
// CHECK: Function Attrs: noinline nounwind optnone |
| 103 |
// CHECK-LABEL: define {{[^@]+}}@caller6 |
| 104 |
// CHECK-SAME: () #[[ATTR1]] { |
| 105 |
// CHECK-NEXT: entry: |
| 106 |
// CHECK-NEXT: [[CALL:%.*]] = call i32 @no_def_explicit_default_first() |
| 107 |
// CHECK-NEXT: ret i32 [[CALL]] |
| 108 |
// |
| 109 |
// |
| 110 |
// CHECK-LABEL: define {{[^@]+}}@implicit_default_decl_first.resolver() |
| 111 |
// CHECK-SAME: #[[ATTR_RESOLVER:[0-9]+]] comdat { |
| 112 |
// CHECK-NEXT: resolver_entry: |
| 113 |
// CHECK-NEXT: ret ptr @implicit_default_decl_first.default |
| 114 |
// |
| 115 |
// |
| 116 |
// CHECK-LABEL: define {{[^@]+}}@explicit_default_def_first.resolver() |
| 117 |
// CHECK-SAME: #[[ATTR_RESOLVER]] comdat { |
| 118 |
// CHECK-NEXT: resolver_entry: |
| 119 |
// CHECK-NEXT: ret ptr @explicit_default_def_first.default |
| 120 |
// |
| 121 |
// |
| 122 |
// CHECK-LABEL: define {{[^@]+}}@implicit_default_def_first.resolver() |
| 123 |
// CHECK-SAME: #[[ATTR_RESOLVER]] comdat { |
| 124 |
// CHECK-NEXT: resolver_entry: |
| 125 |
// CHECK-NEXT: ret ptr @implicit_default_def_first.default |
| 126 |
// |
| 127 |
// |
| 128 |
// CHECK-LABEL: define {{[^@]+}}@explicit_default_decl_first.resolver() |
| 129 |
// CHECK-SAME: #[[ATTR_RESOLVER]] comdat { |
| 130 |
// CHECK-NEXT: resolver_entry: |
| 131 |
// CHECK-NEXT: ret ptr @explicit_default_decl_first.default |
| 132 |
// |
| 133 |
// |
| 134 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 135 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@caller1 |
| 136 |
// CHECK-NOFMV-SAME: () #[[ATTR0:[0-9]+]] { |
| 137 |
// CHECK-NOFMV-NEXT: entry: |
| 138 |
// CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @implicit_default_decl_first() |
| 139 |
// CHECK-NOFMV-NEXT: ret i32 [[CALL]] |
| 140 |
// |
| 141 |
// |
| 142 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 143 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@implicit_default_decl_first |
| 144 |
// CHECK-NOFMV-SAME: () #[[ATTR1:[0-9]+]] { |
| 145 |
// CHECK-NOFMV-NEXT: entry: |
| 146 |
// CHECK-NOFMV-NEXT: ret i32 1 |
| 147 |
// |
| 148 |
// |
| 149 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 150 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@caller2 |
| 151 |
// CHECK-NOFMV-SAME: () #[[ATTR0]] { |
| 152 |
// CHECK-NOFMV-NEXT: entry: |
| 153 |
// CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @explicit_default_def_first() |
| 154 |
// CHECK-NOFMV-NEXT: ret i32 [[CALL]] |
| 155 |
// |
| 156 |
// |
| 157 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 158 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@explicit_default_def_first |
| 159 |
// CHECK-NOFMV-SAME: () #[[ATTR1]] { |
| 160 |
// CHECK-NOFMV-NEXT: entry: |
| 161 |
// CHECK-NOFMV-NEXT: ret i32 2 |
| 162 |
// |
| 163 |
// |
| 164 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 165 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@implicit_default_def_first |
| 166 |
// CHECK-NOFMV-SAME: () #[[ATTR0]] { |
| 167 |
// CHECK-NOFMV-NEXT: entry: |
| 168 |
// CHECK-NOFMV-NEXT: ret i32 3 |
| 169 |
// |
| 170 |
// |
| 171 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 172 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@caller3 |
| 173 |
// CHECK-NOFMV-SAME: () #[[ATTR0]] { |
| 174 |
// CHECK-NOFMV-NEXT: entry: |
| 175 |
// CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @implicit_default_def_first() |
| 176 |
// CHECK-NOFMV-NEXT: ret i32 [[CALL]] |
| 177 |
// |
| 178 |
// |
| 179 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 180 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@caller4 |
| 181 |
// CHECK-NOFMV-SAME: () #[[ATTR0]] { |
| 182 |
// CHECK-NOFMV-NEXT: entry: |
| 183 |
// CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @explicit_default_decl_first() |
| 184 |
// CHECK-NOFMV-NEXT: ret i32 [[CALL]] |
| 185 |
// |
| 186 |
// |
| 187 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 188 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@explicit_default_decl_first |
| 189 |
// CHECK-NOFMV-SAME: () #[[ATTR1]] { |
| 190 |
// CHECK-NOFMV-NEXT: entry: |
| 191 |
// CHECK-NOFMV-NEXT: ret i32 4 |
| 192 |
// |
| 193 |
// |
| 194 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 195 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@caller5 |
| 196 |
// CHECK-NOFMV-SAME: () #[[ATTR0]] { |
| 197 |
// CHECK-NOFMV-NEXT: entry: |
| 198 |
// CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @no_def_implicit_default_first() |
| 199 |
// CHECK-NOFMV-NEXT: ret i32 [[CALL]] |
| 200 |
// |
| 201 |
// |
| 202 |
// CHECK-NOFMV: Function Attrs: noinline nounwind optnone |
| 203 |
// CHECK-NOFMV-LABEL: define {{[^@]+}}@caller6 |
| 204 |
// CHECK-NOFMV-SAME: () #[[ATTR0]] { |
| 205 |
// CHECK-NOFMV-NEXT: entry: |
| 206 |
// CHECK-NOFMV-NEXT: [[CALL:%.*]] = call i32 @no_def_explicit_default_first() |
| 207 |
// CHECK-NOFMV-NEXT: ret i32 [[CALL]] |
| 208 |
// |
| 209 |
//. |
| 210 |
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} |
| 211 |
// CHECK: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"} |
| 212 |
//. |
| 213 |
// CHECK-NOFMV: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} |
| 214 |
// CHECK-NOFMV: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"} |
| 215 |
//. |