blob: 963f484eb55e48c4f1dd50e280140e07f8704817 [file] [log] [blame]
Chandler Carruth3a040e62015-12-27 08:41:34 +00001; 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 Inge6b6a1612013-03-21 00:55:59 +00004
5declare i8* @fopen(i8*, i8*)
Nick Lewyckyc2ec0722013-07-06 00:29:58 +00006; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0:#[0-9]]]
Meador Inge6b6a1612013-03-21 00:55:59 +00007
8declare i8 @strlen(i8*)
9; CHECK: declare i8 @strlen(i8* nocapture) [[G1:#[0-9]]]
10
11declare i32* @realloc(i32*, i32)
12; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) [[G0]]
13
14; Test deliberately wrong declaration
15
16declare i32 @strcpy(...)
17; CHECK: declare i32 @strcpy(...)
18
Michael Gottesman2db11162013-07-03 04:00:54 +000019declare i32 @gettimeofday(i8*, i8*)
Michael Gottesmanbed2e822013-07-03 04:15:22 +000020; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]]
Michael Gottesman2db11162013-07-03 04:00:54 +000021
Meador Inge6b6a1612013-03-21 00:55:59 +000022; CHECK: attributes [[G0]] = { nounwind }
23; CHECK: attributes [[G1]] = { nounwind readonly }
Michael Gottesmanbed2e822013-07-03 04:15:22 +000024; CHECK-POSIX: attributes [[G0]] = { nounwind }