1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/tools/llvm-extract/recursive.ll
David Callahan 190dbc4beb Include invoke'd functions for recursive extract
Summary: When recursively extracting a function from a bit code file, include functions mentioned in InvokeInst as well as CallInst

Reviewers: loladiro, espindola, volkan

Reviewed By: loladiro

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 357735
2019-04-04 23:30:47 +00:00

40 lines
850 B
LLVM

; RUN: llvm-extract -func=a --recursive %s -S | FileCheck --check-prefix=CHECK-AB %s
; RUN: llvm-extract -func=a --recursive --delete %s -S | FileCheck --check-prefix=CHECK-CD %s
; RUN: llvm-extract -func=d --recursive %s -S | FileCheck --check-prefix=CHECK-CD %s
; RUN: llvm-extract -func=e --recursive %s -S | FileCheck --check-prefix=CHECK-CD %s
; CHECK-AB: define void @a
; CHECK-AB: define void @b
; CHECK-AB-NOT: define void @c
; CHECK-AB-NOT: define void @d
; CHECK-CD-NOT: define void @a
; CHECK-CD-NOT: define void @b
; CHECK-CD: define void @c
; CHECK-CD: define void @d
define void @a() {
call void @b()
ret void
}
define void @b() {
ret void
}
define void @c() {
call void @d()
ret void
}
define void @d() {
call void @c()
ret void
}
define void @e() {
invoke void @c()
to label %L unwind label %L
L:
ret void
}