Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -functionattrs -S | FileCheck %s |
| 2 | ; RUN: opt < %s -passes=function-attrs -S | FileCheck %s |
| 3 | |
| 4 | @x = global i32 0 |
| 5 | |
| 6 | define void @test_opt(i8* %p) { |
| 7 | ; CHECK-LABEL: @test_opt |
| 8 | ; CHECK: (i8* nocapture readnone %p) #0 { |
| 9 | ret void |
| 10 | } |
| 11 | |
| 12 | define void @test_optnone(i8* %p) noinline optnone { |
| 13 | ; CHECK-LABEL: @test_optnone |
| 14 | ; CHECK: (i8* %p) #1 { |
| 15 | ret void |
| 16 | } |
| 17 | |
| 18 | declare i8 @strlen(i8*) noinline optnone |
| 19 | ; CHECK-LABEL: @strlen |
| 20 | ; CHECK: (i8*) #1 |
| 21 | |
| 22 | ; CHECK-LABEL: attributes #0 |
| 23 | ; CHECK: = { norecurse nounwind readnone } |
| 24 | ; CHECK-LABEL: attributes #1 |
| 25 | ; CHECK: = { noinline optnone } |