With vector deleting destructors, it's common to include function aliases in vftables. After #185653 it's become more likely that the alias gets overridden in a different TU. It's therefore important that it's the alias itself that goes in the control-flow guard table.
29 lines
621 B
LLVM
29 lines
621 B
LLVM
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s
|
|
|
|
; CHECK: .section .gfids$y
|
|
; CHECK: .symidx alias
|
|
; CHECK-NOT: .symidx calledalias
|
|
; CHECK-NOT: .symidx func
|
|
|
|
|
|
define void @func() {
|
|
ret void
|
|
}
|
|
|
|
@alias = alias ptr, ptr @func
|
|
|
|
; This makes @alias a potential indirect call target.
|
|
; The aliasee (@func) is not considered as such.
|
|
@ptrs = global [1 x ptr] [ptr @alias]
|
|
|
|
@calledalias = alias ptr, ptr @func
|
|
|
|
define void @caller() {
|
|
; A direct call does not make the alias an indirect call target.
|
|
call void @calledalias()
|
|
ret void
|
|
}
|
|
|
|
!llvm.module.flags = !{!0}
|
|
!0 = !{i32 2, !"cfguard", i32 2}
|