53 lines · plain
1; RUN: opt -passes=strip-dead-cg-profile %s -S -o - | FileCheck %s --check-prefix=NOOP2; RUN: llvm-extract %s -func=a -S -o - | FileCheck %s --check-prefix=EXTRACT-A3; RUN: llvm-extract %s -func=a --func=b -S -o - | FileCheck %s --check-prefix=EXTRACT-AB4; RUN: llvm-extract %s -func=solo -S -o - | FileCheck %s --check-prefix=NOTHING-LEFT5 6define void @a() {7 call void @b()8 ret void9}10 11define void @b() {12 call void @c()13 ret void14}15 16define void @c() {17 call void @d()18 ret void19}20 21define void @d() {22 ret void23}24 25define void @solo() {26 ret void27}28 29!llvm.module.flags = !{!0}30 31!0 = !{i32 5, !"CG Profile", !1}32!1 = !{!2, !3, !4}33!2 = !{ptr @a, ptr @b, i64 42}34!3 = !{ptr @b, ptr @c, i64 20}35!4 = !{ptr @c, ptr @d, i64 101}36 37; NOOP: !0 = !{i32 5, !"CG Profile", !1}38; NOOP-NEXT: !1 = distinct !{!2, !3, !4}39; NOOP-NEXT: !2 = !{ptr @a, ptr @b, i64 42}40; NOOP-NEXT: !3 = !{ptr @b, ptr @c, i64 20}41; NOOP-NEXT: !4 = !{ptr @c, ptr @d, i64 101}42 43; EXTRACT-A: !0 = !{i32 5, !"CG Profile", !1}44; EXTRACT-A-NEXT: !1 = distinct !{!2}45; EXTRACT-A-NEXT: !2 = !{ptr @a, ptr @b, i64 42}46 47; EXTRACT-AB: !0 = !{i32 5, !"CG Profile", !1}48; EXTRACT-AB-NEXT: !1 = distinct !{!2, !3}49; EXTRACT-AB-NEXT: !2 = !{ptr @a, ptr @b, i64 42}50; EXTRACT-AB-NEXT: !3 = !{ptr @b, ptr @c, i64 20}51 52; NOTHING-LEFT: !0 = !{i32 5, !"CG Profile", !1}53; NOTHING-LEFT-NEXT: !1 = distinct !{}