1// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm %s -o - | FileCheck %s
2int c(void) __attribute__((const));
3int p(void) __attribute__((pure));
4int t(void);
5
6// CHECK: define i32 @_Z1fv() [[TF:#[0-9]+]] {
7int f(void) {
8  // CHECK: call i32 @_Z1cv() [[NUW_RN_CALL:#[0-9]+]]
9  // CHECK: call i32 @_Z1pv() [[NUW_RO_CALL:#[0-9]+]]
10  return c() + p() + t();
11}
12
13// CHECK: declare i32 @_Z1cv() [[NUW_RN:#[0-9]+]]
14// CHECK: declare i32 @_Z1pv() [[NUW_RO:#[0-9]+]]
15// CHECK: declare i32 @_Z1tv() [[TF]]
16
17// CHECK: attributes [[TF]] = { {{.*}} }
18// CHECK: attributes [[NUW_RN]] = { nounwind readnone{{.*}} }
19// CHECK: attributes [[NUW_RO]] = { nounwind readonly{{.*}} }
20// CHECK: attributes [[NUW_RN_CALL]] = { nounwind readnone }
21// CHECK: attributes [[NUW_RO_CALL]] = { nounwind readonly }
22