Chandler Carruth | 3a040e6 | 2015-12-27 08:41:34 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -inferattrs -S | FileCheck %s |
| 2 | ; RUN: opt < %s -passes=inferattrs -S | FileCheck %s |
| 3 | ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck -check-prefix=CHECK-POSIX %s |
Meador Inge | 6b6a161 | 2013-03-21 00:55:59 +0000 | [diff] [blame] | 4 | |
| 5 | declare i8* @fopen(i8*, i8*) |
Nick Lewycky | c2ec072 | 2013-07-06 00:29:58 +0000 | [diff] [blame] | 6 | ; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0:#[0-9]]] |
Meador Inge | 6b6a161 | 2013-03-21 00:55:59 +0000 | [diff] [blame] | 7 | |
| 8 | declare i8 @strlen(i8*) |
| 9 | ; CHECK: declare i8 @strlen(i8* nocapture) [[G1:#[0-9]]] |
| 10 | |
| 11 | declare i32* @realloc(i32*, i32) |
| 12 | ; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) [[G0]] |
| 13 | |
| 14 | ; Test deliberately wrong declaration |
| 15 | |
| 16 | declare i32 @strcpy(...) |
| 17 | ; CHECK: declare i32 @strcpy(...) |
| 18 | |
Philip Reames | 2466719 | 2016-01-04 22:49:23 +0000 | [diff] [blame] | 19 | ; operator new routines |
| 20 | declare i8* @_Znwj(i64) |
| 21 | ; CHECK: declare noalias nonnull i8* @_Znwj(i64) |
| 22 | declare i8* @_Znwm(i64) |
| 23 | ; CHECK: declare noalias nonnull i8* @_Znwm(i64) |
| 24 | |
Philip Reames | ae050a5 | 2016-01-06 04:53:16 +0000 | [diff] [blame] | 25 | declare void @memset_pattern16(i8*, i8*, i64) |
| 26 | ; CHECK: declare void @memset_pattern16(i8*, i8*, i64) |
| 27 | ; CHECK-POSIX: declare void @memset_pattern16(i8*, i8* readonly, i64) [[G2:#[0-9]+]] |
| 28 | |
Michael Gottesman | 2db1116 | 2013-07-03 04:00:54 +0000 | [diff] [blame] | 29 | declare i32 @gettimeofday(i8*, i8*) |
Michael Gottesman | bed2e82 | 2013-07-03 04:15:22 +0000 | [diff] [blame] | 30 | ; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]] |
Michael Gottesman | 2db1116 | 2013-07-03 04:00:54 +0000 | [diff] [blame] | 31 | |
Meador Inge | 6b6a161 | 2013-03-21 00:55:59 +0000 | [diff] [blame] | 32 | ; CHECK: attributes [[G0]] = { nounwind } |
| 33 | ; CHECK: attributes [[G1]] = { nounwind readonly } |
Michael Gottesman | bed2e82 | 2013-07-03 04:15:22 +0000 | [diff] [blame] | 34 | ; CHECK-POSIX: attributes [[G0]] = { nounwind } |
Philip Reames | ae050a5 | 2016-01-06 04:53:16 +0000 | [diff] [blame] | 35 | ; CHECK-POSIX: attributes [[G2]] = { argmemonly } |