brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 7e60e6a Raw
39 lines · plain
1; This tests directly annotating a function with marked_for_windows_hot_patching.2;3; RUN: llc -mtriple=x86_64-windows < %s | FileCheck %s4 5source_filename = ".\\ms-secure-hotpatch-attr.ll"6target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"7target triple = "x86_64-pc-windows-msvc19.36.32537"8 9@some_global_var = external global i3210 11define noundef i32 @this_gets_hotpatched() #0 {12    %1 = load i32, ptr @some_global_var13    %2 = add i32 %1, 114    ret i32 %215}16 17attributes #0 = { "marked_for_windows_hot_patching" mustprogress noinline nounwind optnone uwtable }18 19; CHECK: this_gets_hotpatched: # @this_gets_hotpatched20; CHECK-NEXT: bb.0:21; CHECK-NEXT: movq __ref_some_global_var(%rip), %rax22; CHECK-NEXT: movl (%rax), %eax23; CHECK-NEXT: addl $1, %eax24; CHECK-NEXT: retq25 26define noundef i32 @this_does_not_get_hotpatched() #1 {27    %1 = load i32, ptr @some_global_var28    %2 = add i32 %1, 129    ret i32 %230}31 32attributes #1 = { mustprogress noinline nounwind optnone uwtable }33 34; CHECK: this_does_not_get_hotpatched: # @this_does_not_get_hotpatched35; CHECK-NEXT: bb.0:36; CHECK-NEXT: movl some_global_var(%rip), %eax37; CHECK-NEXT: addl $1, %eax38; CHECK-NEXT: retq39