blob: 35fed7bf0d459a59df467948e3c7a172ca2f2032 [file] [log] [blame]
Ulrich Weigand35668cc2012-10-24 12:22:56 +00001// RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm %s -o - | FileCheck %s
Eric Christopherbf005ec2011-08-15 22:38:22 +00002int c(void) __attribute__((const));
3int p(void) __attribute__((pure));
4int t(void);
5
Bill Wendling985d1c52013-02-15 21:30:01 +00006// CHECK: define i32 @_Z1fv() {{.*}} {
Eric Christopherbf005ec2011-08-15 22:38:22 +00007int f(void) {
Eric Christopherd9afc5c2011-08-15 22:48:14 +00008 // CHECK: call i32 @_Z1cv() nounwind readnone
9 // CHECK: call i32 @_Z1pv() nounwind readonly
Eric Christopherbf005ec2011-08-15 22:38:22 +000010 return c() + p() + t();
11}
Eric Christopherd9afc5c2011-08-15 22:48:14 +000012
Bill Wendlingc33fc4c2013-02-20 07:22:19 +000013// CHECK: declare i32 @_Z1cv() #1
14// CHECK: declare i32 @_Z1pv() #2
15// CHECK: declare i32 @_Z1tv() #0
16
17// CHECK: attributes #0 = { "target-features"={{.*}} }
18// CHECK: attributes #1 = { nounwind readnone "target-features"={{.*}} }
19// CHECK: attributes #2 = { nounwind readonly "target-features"={{.*}} }