40 lines · plain
1; This tests annotating a function with marked_for_windows_hot_patching by using --ms-hotpatch-functions-file.2;3; RUN: echo this_gets_hotpatched > %t.patch-functions.txt4; RUN: llc -mtriple=x86_64-windows --ms-secure-hotpatch-functions-file=%t.patch-functions.txt < %s | FileCheck %s5 6source_filename = ".\\ms-secure-hotpatch-functions-file.ll"7target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"8target triple = "x86_64-pc-windows-msvc19.36.32537"9 10@some_global_var = external global i3211 12define noundef i32 @this_gets_hotpatched() #0 {13 %1 = load i32, ptr @some_global_var14 %2 = add i32 %1, 115 ret i32 %216}17 18attributes #0 = { mustprogress noinline nounwind optnone uwtable }19 20; CHECK: this_gets_hotpatched: # @this_gets_hotpatched21; CHECK-NEXT: bb.0:22; CHECK-NEXT: movq __ref_some_global_var(%rip), %rax23; CHECK-NEXT: movl (%rax), %eax24; CHECK-NEXT: addl $1, %eax25; CHECK-NEXT: retq26 27define noundef i32 @this_does_not_get_hotpatched() #1 {28 %1 = load i32, ptr @some_global_var29 %2 = add i32 %1, 130 ret i32 %231}32 33attributes #1 = { mustprogress noinline nounwind optnone uwtable }34 35; CHECK: this_does_not_get_hotpatched: # @this_does_not_get_hotpatched36; CHECK-NEXT: bb.0:37; CHECK-NEXT: movl some_global_var(%rip), %eax38; CHECK-NEXT: addl $1, %eax39; CHECK-NEXT: retq40