[ELF] MergeInputSection: replace Fatal with Err
[llvm-project.git] / clang / test / CodeGen / arm64ec-hybrid-patchable.c
blob4d1fa12afd2aae57445b8faf91c9ed622f2db92e
1 // REQUIRES: aarch64-registered-target
2 // RUN: %clang_cc1 -triple arm64ec-pc-windows -fms-extensions -emit-llvm -o - %s -verify | FileCheck %s
4 // CHECK: ; Function Attrs: hybrid_patchable noinline nounwind optnone
5 // CHECK-NEXT: define dso_local i32 @func() #0 {
6 int __attribute__((hybrid_patchable)) func(void) { return 1; }
8 // CHECK: ; Function Attrs: hybrid_patchable noinline nounwind optnone
9 // CHECK-NEXT: define dso_local i32 @func2() #0 {
10 int __declspec(hybrid_patchable) func2(void) { return 2; }
12 // CHECK: ; Function Attrs: hybrid_patchable noinline nounwind optnone
13 // CHECK-NEXT: define dso_local i32 @func3() #0 {
14 int __declspec(hybrid_patchable) func3(void);
15 int func3(void) { return 3; }
17 // CHECK: ; Function Attrs: hybrid_patchable noinline nounwind optnone
18 // CHECK-NEXT: define dso_local i32 @func4() #0 {
19 [[clang::hybrid_patchable]] int func4(void);
20 int func4(void) { return 3; }
22 // CHECK: ; Function Attrs: hybrid_patchable noinline nounwind optnone
23 // CHECK-NEXT: define internal void @static_func() #0 {
24 // expected-warning@+1 {{'hybrid_patchable' is ignored on functions without external linkage}}
25 static void __declspec(hybrid_patchable) static_func(void) {}
27 // CHECK: ; Function Attrs: hybrid_patchable noinline nounwind optnone
28 // CHECK-NEXT: define linkonce_odr dso_local i32 @func5() #0 comdat {
29 int inline __declspec(hybrid_patchable) func5(void) { return 4; }
31 void caller(void) {
32 static_func();
33 func5();