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