diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-10-28 20:43:56 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-10-28 20:43:56 +0000 |
commit | fffc1ce1d7f60bf76b98c22b1af7aa0eeed51a31 (patch) | |
tree | 436363dc37657340adebf151651af721b9919fd6 /clang/test/CodeGen/pr9614.c | |
parent | 409b694c6c1687551658e87833c1aa6db8bdf347 (diff) | |
download | bcm5719-llvm-fffc1ce1d7f60bf76b98c22b1af7aa0eeed51a31.tar.gz bcm5719-llvm-fffc1ce1d7f60bf76b98c22b1af7aa0eeed51a31.zip |
Fix PR9614 for functions with the always_inline attribute. Try to keep
the common case (-O0, no always_inline) fast.
llvm-svn: 143222
Diffstat (limited to 'clang/test/CodeGen/pr9614.c')
-rw-r--r-- | clang/test/CodeGen/pr9614.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/clang/test/CodeGen/pr9614.c b/clang/test/CodeGen/pr9614.c index 68a59095ab3..e761bec3f91 100644 --- a/clang/test/CodeGen/pr9614.c +++ b/clang/test/CodeGen/pr9614.c @@ -1,15 +1,23 @@ // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s -extern int foo_alias (void) __asm ("foo"); -inline int foo (void) { +extern void foo_alias (void) __asm ("foo"); +inline void foo (void) { return foo_alias (); } -int f(void) { - return foo(); +extern void bar_alias (void) __asm ("bar"); +inline __attribute__ ((__always_inline__)) void bar (void) { + return bar_alias (); } +void f(void) { + foo(); + bar(); +} + +// CHECK: define void @f() +// CHECK-NEXT: entry: +// CHECK-NEXT: call void @foo() +// CHECK-NEXT: call void @bar() +// CHECK-NEXT: ret void -// CHECK-NOT: define -// CHECK: define i32 @f() -// CHECK: call i32 @foo() -// CHECK-NEXT: ret i32 -// CHECK-NOT: define +// CHECK: declare void @foo() +// CHECK: declare void @bar() |