1 ;; Test that function attributes "no-frame-pointer-elim" ("true" or "false") and
2 ;; "no-frame-pointer-elim-non-leaf" (value is ignored) can be upgraded to
5 ; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s
7 ; CHECK: define void @all0() #0
8 define void @all0() "no-frame-pointer-elim"="true" { ret void }
9 ; CHECK: define void @all1() #1
10 define void @all1() #0 { ret void }
12 ; CHECK: define void @non_leaf0() #2
13 define void @non_leaf0() "no-frame-pointer-elim-non-leaf" { ret void }
14 ; CHECK: define void @non_leaf1() #3
15 define void @non_leaf1() #1 { ret void }
17 ; CHECK: define void @none() #4
18 define void @none() "no-frame-pointer-elim"="false" { ret void }
20 ;; Don't add "frame-pointer" if neither "no-frame-pointer-elim" nor
21 ;; "no-frame-pointer-elim-non-leaf" is present.
22 ; CHECK: define void @no_attr() {
23 define void @no_attr() { ret void }
25 attributes #0 = { readnone "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" }
26 attributes #1 = { readnone "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" }
28 ;; Other attributes (e.g. readnone) are unaffected.
29 ; CHECK: attributes #0 = { "frame-pointer"="all" }
30 ; CHECK: attributes #1 = { readnone "frame-pointer"="all" }
31 ; CHECK: attributes #2 = { "frame-pointer"="non-leaf" }
32 ; CHECK: attributes #3 = { readnone "frame-pointer"="non-leaf" }
33 ; CHECK: attributes #4 = { "frame-pointer"="none" }