1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=attributes --test FileCheck --test-arg -check-prefixes=INTERESTING,INTERESTING-NOINLINE --test-arg %s --test-arg --input-file %s -o %t.0
2 ; RUN: FileCheck --check-prefix=RESULT-NOINLINE %s < %t.0
4 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=attributes --test FileCheck --test-arg -check-prefixes=INTERESTING,INTERESTING-OPTNONE --test-arg %s --test-arg --input-file %s -o %t.1
5 ; RUN: FileCheck --check-prefix=RESULT-OPTNONE %s < %t.1
8 ; Make sure this doesn't hit the "Attribute 'optnone' requires
9 ; 'noinline'!" verifier error. optnone can be dropped separately from
10 ; noinline, but removing noinline requires removing the pair together.
13 ; INTERESTING: @keep_func() [[KEEP_ATTRS:#[0-9]+]]
14 ; RESULT-NOINLINE: define void @keep_func() [[KEEP_ATTRS:#[0-9]+]] {
15 ; RESULT-OPTNONE: define void @keep_func() [[KEEP_ATTRS:#[0-9]+]] {
16 define void @keep_func() #0 {
20 ; Both should be removed together
21 ; INTERESTING: @drop_func()
22 ; RESULT-NOINLINE: define void @drop_func() {
23 ; RESULT-OPTNONE: define void @drop_func() {
24 define void @drop_func() #0 {
28 ; RESULT-NOINLINE: attributes [[KEEP_ATTRS]] = { noinline }
29 ; RESULT-OPTNONE: attributes [[KEEP_ATTRS]] = { noinline optnone }
32 ; INTERESTING-NOINLINE: attributes [[KEEP_ATTRS]] =
33 ; INTERESTING-NOINLINE-SAME: noinline
35 ; INTERESTING-OPTNONE: attributes [[KEEP_ATTRS]] =
36 ; INTERESTING-OPTNONE-SAME: optnone
38 attributes #0 = { noinline optnone }