2013-03-21 00:55:59 +00:00
|
|
|
; RUN: opt < %s -functionattrs -S | FileCheck %s
|
2009-01-04 20:27:34 +00:00
|
|
|
|
2013-07-06 00:29:58 +00:00
|
|
|
; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) #0
|
2009-01-04 20:27:34 +00:00
|
|
|
declare i8* @fopen(i8*, i8*)
|
2013-02-11 08:34:57 +00:00
|
|
|
|
2013-02-20 07:21:42 +00:00
|
|
|
; CHECK: declare i8 @strlen(i8* nocapture) #1
|
2009-01-04 20:27:34 +00:00
|
|
|
declare i8 @strlen(i8*)
|
2013-02-11 08:34:57 +00:00
|
|
|
|
2013-02-20 07:21:42 +00:00
|
|
|
; CHECK: declare noalias i32* @realloc(i32* nocapture, i32) #0
|
2009-01-18 04:46:10 +00:00
|
|
|
declare i32* @realloc(i32*, i32)
|
2009-01-04 20:27:34 +00:00
|
|
|
|
|
|
|
; Test deliberately wrong declaration
|
|
|
|
declare i32 @strcpy(...)
|
2013-02-11 08:34:57 +00:00
|
|
|
|
|
|
|
; CHECK-NOT: strcpy{{.*}}noalias
|
|
|
|
; CHECK-NOT: strcpy{{.*}}nocapture
|
|
|
|
; CHECK-NOT: strcpy{{.*}}nounwind
|
|
|
|
; CHECK-NOT: strcpy{{.*}}readonly
|
2013-02-20 07:21:42 +00:00
|
|
|
|
|
|
|
; CHECK: attributes #0 = { nounwind }
|
|
|
|
; CHECK: attributes #1 = { nounwind readonly }
|