brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 4d1fa12 Raw
35 lines · c
1// REQUIRES: aarch64-registered-target2// RUN: %clang_cc1 -triple arm64ec-pc-windows -fms-extensions -emit-llvm -o - %s -verify | FileCheck %s3 4// CHECK: ;    Function Attrs: hybrid_patchable noinline nounwind optnone5// CHECK-NEXT: define dso_local i32 @func() #0 {6int __attribute__((hybrid_patchable)) func(void) {  return 1; }7 8// CHECK: ;    Function Attrs: hybrid_patchable noinline nounwind optnone9// CHECK-NEXT: define dso_local i32 @func2() #0 {10int __declspec(hybrid_patchable) func2(void) {  return 2; }11 12// CHECK: ;    Function Attrs: hybrid_patchable noinline nounwind optnone13// CHECK-NEXT: define dso_local i32 @func3() #0 {14int __declspec(hybrid_patchable) func3(void);15int func3(void) {  return 3; }16 17// CHECK: ;    Function Attrs: hybrid_patchable noinline nounwind optnone18// CHECK-NEXT: define dso_local i32 @func4() #0 {19[[clang::hybrid_patchable]] int func4(void);20int func4(void) {  return 3; }21 22// CHECK: ; Function Attrs: hybrid_patchable noinline nounwind optnone23// CHECK-NEXT: define internal void @static_func() #0 {24// expected-warning@+1 {{'hybrid_patchable' is ignored on functions without external linkage}}25static void __declspec(hybrid_patchable) static_func(void) {}26 27// CHECK: ;    Function Attrs: hybrid_patchable noinline nounwind optnone28// CHECK-NEXT: define linkonce_odr dso_local i32 @func5() #0 comdat {29int inline __declspec(hybrid_patchable) func5(void) {  return 4; }30 31void caller(void) {32  static_func();33  func5();34}35