diff options
author | Hans Wennborg <hans@hanshq.net> | 2016-05-24 23:37:56 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2016-05-24 23:37:56 +0000 |
commit | 9464491aa710a7dab1939420ea137effe4876592 (patch) | |
tree | 6e21fc333155202f28246066738b8d2b796ba389 /clang/test/CodeGen/inline-optim.c | |
parent | af432a45e3218d29ce322ff2a074ad3b230b13f5 (diff) | |
download | bcm5719-llvm-9464491aa710a7dab1939420ea137effe4876592.tar.gz bcm5719-llvm-9464491aa710a7dab1939420ea137effe4876592.zip |
Rename test/CodeGen/inline-optim.cc to .c and provide a triple
llvm-svn: 270633
Diffstat (limited to 'clang/test/CodeGen/inline-optim.c')
-rw-r--r-- | clang/test/CodeGen/inline-optim.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGen/inline-optim.c b/clang/test/CodeGen/inline-optim.c new file mode 100644 index 00000000000..7ee9c033410 --- /dev/null +++ b/clang/test/CodeGen/inline-optim.c @@ -0,0 +1,26 @@ +// Make sure -finline-functions family flags are behaving correctly. + +// RUN: %clang_cc1 -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck -check-prefix=NOINLINE %s +// RUN: %clang_cc1 -triple i686-pc-win32 -O3 -fno-inline-functions -emit-llvm %s -o - | FileCheck -check-prefix=NOINLINE %s +// RUN: %clang_cc1 -triple i686-pc-win32 -finline-functions -emit-llvm %s -o - | FileCheck -check-prefix=INLINE %s + +inline int inline_hint(int a, int b) { return(a+b); } + +int inline_no_hint(int a, int b) { return (a/b); } + +inline __attribute__ ((__always_inline__)) int inline_always(int a, int b) { return(a*b); } + +volatile int *pa = (int*) 0x1000; +void foo() { +// NOINLINE-LABEL: @foo +// INLINE-LABEL: @foo +// NOINLINE: call i32 @inline_hint +// INLINE-NOT: call i32 @inline_hint + pa[0] = inline_hint(pa[1],pa[2]); +// NOINLINE-NOT: call i32 @inline_always +// INLINE-NOT: call i32 @inline_always + pa[3] = inline_always(pa[4],pa[5]); +// NOINLINE: call i32 @inline_no_hint +// INLINE-NOT: call i32 @inline_no_hint + pa[6] = inline_no_hint(pa[7], pa[8]); +} |