2012-10-24 20:22:56 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm %s -o - | FileCheck %s
|
2011-08-16 06:38:22 +08:00
|
|
|
int c(void) __attribute__((const));
|
|
|
|
int p(void) __attribute__((pure));
|
|
|
|
int t(void);
|
|
|
|
|
2013-03-01 06:49:57 +08:00
|
|
|
// CHECK: define i32 @_Z1fv() [[TF:#[0-9]+]] {
|
2011-08-16 06:38:22 +08:00
|
|
|
int f(void) {
|
2013-03-01 06:49:57 +08:00
|
|
|
// CHECK: call i32 @_Z1cv() [[NUW_RN_CALL:#[0-9]+]]
|
|
|
|
// CHECK: call i32 @_Z1pv() [[NUW_RO_CALL:#[0-9]+]]
|
2011-08-16 06:38:22 +08:00
|
|
|
return c() + p() + t();
|
|
|
|
}
|
2011-08-16 06:48:14 +08:00
|
|
|
|
2013-03-01 06:49:57 +08:00
|
|
|
// CHECK: declare i32 @_Z1cv() [[NUW_RN:#[0-9]+]]
|
|
|
|
// CHECK: declare i32 @_Z1pv() [[NUW_RO:#[0-9]+]]
|
|
|
|
// CHECK: declare i32 @_Z1tv() [[TF]]
|
2013-02-20 15:22:19 +08:00
|
|
|
|
2013-03-01 06:49:57 +08:00
|
|
|
// CHECK: attributes [[TF]] = { {{.*}} }
|
|
|
|
// CHECK: attributes [[NUW_RN]] = { nounwind readnone{{.*}} }
|
|
|
|
// CHECK: attributes [[NUW_RO]] = { nounwind readonly{{.*}} }
|
|
|
|
// CHECK: attributes [[NUW_RN_CALL]] = { nounwind readnone }
|
|
|
|
// CHECK: attributes [[NUW_RO_CALL]] = { nounwind readonly }
|