Meador Inge | 6b6a161 | 2013-03-21 00:55:59 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -functionattrs -S | FileCheck %s |
Nick Lewycky | 959af7b | 2009-01-04 20:27:34 +0000 | [diff] [blame] | 2 | |
Nick Lewycky | c2ec072 | 2013-07-06 00:29:58 +0000 | [diff] [blame] | 3 | ; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) #0 |
Nick Lewycky | 959af7b | 2009-01-04 20:27:34 +0000 | [diff] [blame] | 4 | declare i8* @fopen(i8*, i8*) |
Bill Wendling | 84ba976 | 2013-02-11 08:34:57 +0000 | [diff] [blame] | 5 | |
Bill Wendling | 90bc19c | 2013-02-20 07:21:42 +0000 | [diff] [blame] | 6 | ; CHECK: declare i8 @strlen(i8* nocapture) #1 |
Nick Lewycky | 959af7b | 2009-01-04 20:27:34 +0000 | [diff] [blame] | 7 | declare i8 @strlen(i8*) |
Bill Wendling | 84ba976 | 2013-02-11 08:34:57 +0000 | [diff] [blame] | 8 | |
Bill Wendling | 90bc19c | 2013-02-20 07:21:42 +0000 | [diff] [blame] | 9 | ; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) #0 |
Nick Lewycky | e5be1cd | 2009-01-18 04:46:10 +0000 | [diff] [blame] | 10 | declare i32* @realloc(i32*, i32) |
Nick Lewycky | 959af7b | 2009-01-04 20:27:34 +0000 | [diff] [blame] | 11 | |
| 12 | ; Test deliberately wrong declaration |
| 13 | declare i32 @strcpy(...) |
Bill Wendling | 84ba976 | 2013-02-11 08:34:57 +0000 | [diff] [blame] | 14 | |
| 15 | ; CHECK-NOT: strcpy{{.*}}noalias |
| 16 | ; CHECK-NOT: strcpy{{.*}}nocapture |
| 17 | ; CHECK-NOT: strcpy{{.*}}nounwind |
| 18 | ; CHECK-NOT: strcpy{{.*}}readonly |
Bill Wendling | 90bc19c | 2013-02-20 07:21:42 +0000 | [diff] [blame] | 19 | |
| 20 | ; CHECK: attributes #0 = { nounwind } |
| 21 | ; CHECK: attributes #1 = { nounwind readonly } |