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