blob: 9fba7a9f2882f4c9be9b8be90b034fdca526f1e4 [file] [log] [blame]
Meador Inge6b6a1612013-03-21 00:55:59 +00001; RUN: opt < %s -functionattrs -S | FileCheck %s
Tim Northover501977e2013-08-12 12:43:26 +00002; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -functionattrs -S | FileCheck -check-prefix=CHECK-POSIX %s
Meador Inge6b6a1612013-03-21 00:55:59 +00003
4declare i8* @fopen(i8*, i8*)
Nick Lewyckyc2ec0722013-07-06 00:29:58 +00005; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0:#[0-9]]]
Meador Inge6b6a1612013-03-21 00:55:59 +00006
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
Michael Gottesman2db11162013-07-03 04:00:54 +000018declare i32 @gettimeofday(i8*, i8*)
Michael Gottesmanbed2e822013-07-03 04:15:22 +000019; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]]
Michael Gottesman2db11162013-07-03 04:00:54 +000020
Meador Inge6b6a1612013-03-21 00:55:59 +000021; CHECK: attributes [[G0]] = { nounwind }
22; CHECK: attributes [[G1]] = { nounwind readonly }
Michael Gottesmanbed2e822013-07-03 04:15:22 +000023; CHECK-POSIX: attributes [[G0]] = { nounwind }