blob: 3828388d48eaaea2162bfe3fe8c763f2230647ee [file] [log] [blame]
Ulrich Weigand92309972012-10-24 12:22:56 +00001// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm %s -o - | FileCheck %s
Eric Christopher041087c2011-08-15 22:38:22 +00002int c(void) __attribute__((const));
3int p(void) __attribute__((pure));
4int t(void);
5
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +00006// CHECK: define i32 @_Z1fv() [[TF:#[0-9]+]] {
Eric Christopher041087c2011-08-15 22:38:22 +00007int f(void) {
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +00008 // CHECK: call i32 @_Z1cv() [[NUW_RN_CALL:#[0-9]+]]
9 // CHECK: call i32 @_Z1pv() [[NUW_RO_CALL:#[0-9]+]]
Eric Christopher041087c2011-08-15 22:38:22 +000010 return c() + p() + t();
11}
Eric Christopherd946bda2011-08-15 22:48:14 +000012
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +000013// CHECK: declare i32 @_Z1cv() [[NUW_RN:#[0-9]+]]
14// CHECK: declare i32 @_Z1pv() [[NUW_RO:#[0-9]+]]
15// CHECK: declare i32 @_Z1tv() [[TF]]
Bill Wendlingf7a9da02013-02-20 07:22:19 +000016
Bill Wendlingbe9e8bf2013-02-28 22:49:57 +000017// 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 }