1; RUN: opt < %s -functionattrs -S | FileCheck %s 2; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -functionattrs -S | FileCheck -check-prefix=CHECK-POSIX %s 3 4declare i8* @fopen(i8*, i8*) 5; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0:#[0-9]]] 6 7declare i8 @strlen(i8*) 8; CHECK: declare i8 @strlen(i8* nocapture) [[G1:#[0-9]]] 9 10declare i32* @realloc(i32*, i32) 11; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) [[G0]] 12 13; Test deliberately wrong declaration 14 15declare i32 @strcpy(...) 16; CHECK: declare i32 @strcpy(...) 17 18declare i32 @gettimeofday(i8*, i8*) 19; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]] 20 21; CHECK: attributes [[G0]] = { nounwind } 22; CHECK: attributes [[G1]] = { nounwind readonly } 23; CHECK-POSIX: attributes [[G0]] = { nounwind } 24