diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2014-05-19 22:14:34 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2014-05-19 22:14:34 +0000 |
| commit | b4728c12e8b6e6f4d1906ec3221ee0a3a124e843 (patch) | |
| tree | e8f050b2013cdd085dda9e756d08397464ed9b25 /clang/test/CodeGenCXX | |
| parent | 973141a0358f5d47f40acdf272b8d6a9f0cbfba6 (diff) | |
| download | bcm5719-llvm-b4728c12e8b6e6f4d1906ec3221ee0a3a124e843.tar.gz bcm5719-llvm-b4728c12e8b6e6f4d1906ec3221ee0a3a124e843.zip | |
Implement the no_split_stack attribute.
This is a GNU attribute that allows split stacks to be turned off on a
per-function basis.
Differential Revision: http://reviews.llvm.org/D3817
llvm-svn: 209167
Diffstat (limited to 'clang/test/CodeGenCXX')
| -rw-r--r-- | clang/test/CodeGenCXX/split-stacks.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/split-stacks.cpp b/clang/test/CodeGenCXX/split-stacks.cpp new file mode 100644 index 00000000000..3e120344d6b --- /dev/null +++ b/clang/test/CodeGenCXX/split-stacks.cpp @@ -0,0 +1,33 @@ +// RUN: %clang -target x86_64-linux-gnu -fsplit-stack -S -std=c++11 %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-SEGSTK %s +// RUN: %clang -target x86_64-linux-gnu -S -std=c++11 %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-NOSEGSTK %s + +int foo() { + return 0; +} + +template <typename T> +[[gnu::no_split_stack]] +int tnosplit() { + return 0; +} + +[[gnu::no_split_stack]] +int nosplit() { + return tnosplit<int>(); +} + +// CHECK-SEGSTK: define i32 @_Z3foov() [[SS:#[0-9]+]] { +// CHECK-SEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { +// CHECK-SEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] { +// CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } +// CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } +// CHECK-SEGSTK: [[SS]] = { {{.*}} "split-stack" {{.*}} } +// CHECK-SEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } +// CHECK-SEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } + +// CHECK-NOSEGSTK: define i32 @_Z3foov() [[NSS0:#[0-9]+]] { +// CHECK-NOSEGSTK: define i32 @_Z7nosplitv() [[NSS1:#[0-9]+]] { +// CHECK-NOSEGSTK: define linkonce_odr i32 @_Z8tnosplitIiEiv() [[NSS2:#[0-9]+]] { +// CHECK-NOSEGSTK-NOT: [[NSS1]] = { {{.*}} "split-stack" {{.*}} } +// CHECK-NOSEGSTK-NOT: [[NSS2]] = { {{.*}} "split-stack" {{.*}} } +// CHECK-NOSEGSTK-NOT: [[NSS3]] = { {{.*}} "split-stack" {{.*}} } |

