1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/test/CodeGen/X86/fentry-insertion.ll
Manoj Gupta 6b73c7cf07 [X86] Fix a crash in FEntryInserter Pass.
Summary:
FEntryInserter pass unconditionally derefs the first Instruction
in the first Basic Block. The pass crashes when the first
BasicBlock is empty. Fix the crash by not dereferencing the basic
Block iterator. This fixes an issue observed when building Linux kernel
4.4 with clang.

Fixes PR33971.

Reviewers: hfinkel, niravd, dblaikie

Reviewed By: niravd

Subscribers: davide, llvm-commits

Differential Revision: https://reviews.llvm.org/D35979

llvm-svn: 309694
2017-08-01 15:39:12 +00:00

31 lines
704 B
LLVM

; RUN: llc %s -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @test1() #0 {
entry:
ret void
; CHECK-LABEL: @test1
; CHECK: callq __fentry__
; CHECK-NOT: mcount
; CHECK: retq
}
define void @test2() #1 {
entry:
br label %bb1
bb1:
call void @address_taken(i64 ptrtoint (i8* blockaddress(@test2, %bb1) to i64), i32 512)
ret void
; CHECK-LABEL: @test2
; CHECK: callq __fentry__
; CHECK-NOT: mcount
; CHECK: retq
}
declare void @address_taken(i64, i32) local_unnamed_addr
attributes #0 = { "fentry-call"="true" }
attributes #1 = { inlinehint minsize noredzone nounwind optsize sspstrong "fentry-call"="true" }