xref: /llvm-project/llvm/test/tools/llvm-reduce/remove-metadata.ll (revision 42067f26cd084d29fdd08a75a36b8785ae9f3982)
1; Test that llvm-reduce can remove uninteresting metadata from an IR file.
2; The Metadata pass erases named & unnamed metadata nodes.
3;
4; RUN: llvm-reduce --aggressive-named-md-reduction --test %python --test-arg %p/Inputs/remove-metadata.py %s -o %t
5; RUN: FileCheck --check-prefixes=AGGRESSIVE --implicit-check-not=! %s < %t
6
7; RUN: llvm-reduce --test %python --test-arg %p/Inputs/remove-metadata.py %s -o %t
8; RUN: FileCheck --implicit-check-not=! %s < %t
9
10@global = global i32 0, !dbg !0
11
12define void @main() !dbg !0 {
13   ret void, !dbg !0
14}
15
16!uninteresting = !{!0}
17; AGGRESSIVE: !interesting = !{}
18; CHECK: !interesting = !{!0}
19!interesting = !{!1}
20
21!0 = !{!"uninteresting"}
22; CHECK: !0 = !{!"interesting"}
23!1 = !{!"interesting"}
24