1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=function-data --test FileCheck --test-arg --check-prefix=CHECK --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck -check-prefixes=CHECK,RESULT %s < %t
4 @gv = linkonce_odr global i32 1
6 ; CHECK: define void @drop_prefix_i32_const()
7 define void @drop_prefix_i32_const() prefix i32 1 {
11 ; CHECK: define void @keep_prefix_i32_const() prefix i32 1 {
12 define void @keep_prefix_i32_const() prefix i32 1 {
16 ; CHECK: define void @drop_prefix_ptr_global()
17 define void @drop_prefix_ptr_global() prefix ptr @gv {
21 ; CHECK: define void @keep_prefix_ptr_global() prefix ptr @gv {
22 define void @keep_prefix_ptr_global() prefix ptr @gv {
26 ; Make sure there's no invalid reduction if the prefix data is really
28 ; CHECK: define i32 @drop_uses_prefix_i32_const()
29 define i32 @drop_uses_prefix_i32_const() prefix i32 1 {
30 %gep = getelementptr inbounds i32, ptr @drop_uses_prefix_i32_const, i32 -1
31 %load = load i32, ptr %gep
35 ; CHECK: define ptr @drop_uses_prefix_gv(
36 define ptr @drop_uses_prefix_gv() prefix ptr @gv {
37 %gep = getelementptr inbounds i32, ptr @drop_uses_prefix_gv, i32 -1
38 %load = load ptr, ptr %gep
43 ; RESULT: declare void @declaration_prefix_i32_const(){{$}}
44 declare void @declaration_prefix_i32_const() prefix i32 2
46 ; RESULT: void @declaration_prefix_ptr_gv(){{$}}
47 declare void @declaration_prefix_ptr_gv() prefix ptr @gv