brintos

brintos / llvm-project-archived public Read only

0
0
Text · 840 B · cbf19ad Raw
27 lines · c
1// REQUIRES: x86-registered-target2 3// This verifies that hotpatch function attributes are correctly propagated through LLVM IR when compiling with LTO.4//5// RUN: %clang_cl -c --target=x86_64-windows-msvc -O2 /Z7 -fms-secure-hotpatch-functions-list=this_gets_hotpatched -flto /Fo%t.bc -- %s6// RUN: llvm-dis %t.bc -o - | FileCheck %s7//8// CHECK-LABEL: define dso_local noundef i32 @this_gets_hotpatched()9// CHECK-SAME: #010//11// CHECK-LABEL: define dso_local noundef i32 @this_does_not_get_hotpatched()12// CHECK-SAME: #113 14// CHECK: attributes #015// CHECK-SAME: "marked_for_windows_hot_patching"16 17// CHECK: attributes #118// CHECK-NOT: "marked_for_windows_hot_patching"19 20int __declspec(noinline) this_gets_hotpatched() {21    return 42;22}23 24int __declspec(noinline) this_does_not_get_hotpatched() {25    return this_gets_hotpatched() + 100;26}27