Matt Arsenault | 77eb1b8 | 2019-12-09 18:39:58 +0530 | [diff] [blame] | 1 | ; RUN: opt < %s -mtriple=x86_64-apple-darwin -frame-pointer=all -S | FileCheck -check-prefixes=ALL,CHECK %s |
| 2 | ; RUN: opt < %s -mtriple=x86_64-apple-darwin -frame-pointer=none -S | FileCheck -check-prefixes=NONE,CHECK %s |
| 3 | ; RUN: opt < %s -mtriple=x86_64-apple-darwin -frame-pointer=non-leaf -S | FileCheck -check-prefixes=NONLEAF,CHECK %s |
| 4 | |
| 5 | ; Check behavior of -frame-pointer flag and frame-pointer atttribute. |
| 6 | |
| 7 | ; CHECK: @no_frame_pointer_attr() [[VARATTR:#[0-9]+]] { |
| 8 | define i32 @no_frame_pointer_attr() #0 { |
| 9 | entry: |
| 10 | ret i32 0 |
| 11 | } |
| 12 | |
| 13 | ; CHECK: @frame_pointer_attr_all() [[ALL_ATTR:#[0-9]+]] { |
| 14 | define i32 @frame_pointer_attr_all() #1 { |
| 15 | entry: |
| 16 | ret i32 0 |
| 17 | } |
| 18 | |
| 19 | ; CHECK: @frame_pointer_attr_none() [[NONE_ATTR:#[0-9]+]] { |
| 20 | define i32 @frame_pointer_attr_none() #2 { |
| 21 | entry: |
| 22 | ret i32 0 |
| 23 | } |
| 24 | |
| 25 | ; CHECK: @frame_pointer_attr_leaf() [[NONLEAF_ATTR:#[0-9]+]] { |
| 26 | define i32 @frame_pointer_attr_leaf() #3 { |
| 27 | entry: |
| 28 | ret i32 0 |
| 29 | } |
| 30 | |
| 31 | ; ALL-DAG: attributes [[VARATTR]] = { nounwind "frame-pointer"="all" } |
| 32 | ; ALL-DAG: attributes [[NONE_ATTR]] = { nounwind "frame-pointer"="none" } |
| 33 | ; ALL-DAG: attributes [[NONLEAF_ATTR]] = { nounwind "frame-pointer"="non-leaf" } |
| 34 | ; ALL-NOT: attributes |
| 35 | |
| 36 | ; NONE-DAG: attributes [[VARATTR]] = { nounwind "frame-pointer"="none" } |
| 37 | ; NONE-DAG: attributes [[ALL_ATTR]] = { nounwind "frame-pointer"="all" } |
| 38 | ; NONE-DAG: attributes [[NONLEAF_ATTR]] = { nounwind "frame-pointer"="non-leaf" } |
| 39 | ; NONE-NOT: attributes |
| 40 | |
| 41 | ; NONLEAF-DAG: attributes [[VARATTR]] = { nounwind "frame-pointer"="non-leaf" } |
| 42 | ; NONLEAF-DAG: attributes [[ALL_ATTR]] = { nounwind "frame-pointer"="all" } |
| 43 | ; NONLEAF-DAG: attributes [[NONE_ATTR]] = { nounwind "frame-pointer"="none" } |
| 44 | ; NONLEAF-NOT: attributes |
| 45 | |
| 46 | |
| 47 | attributes #0 = { nounwind } |
| 48 | attributes #1 = { nounwind "frame-pointer"="all" } |
| 49 | attributes #2 = { nounwind "frame-pointer"="none" } |
| 50 | attributes #3 = { nounwind "frame-pointer"="non-leaf" } |