diff options
author | whitequark <whitequark@whitequark.org> | 2017-06-21 18:46:50 +0000 |
---|---|---|
committer | whitequark <whitequark@whitequark.org> | 2017-06-21 18:46:50 +0000 |
commit | ed54b4a7985000624229f2375233eb3c6a9b23fc (patch) | |
tree | ca66ba5e0f61c8b2d913d4e974bba1b53a363313 /llvm/test/Transforms/Inline/inline-probe-stack.ll | |
parent | 47f856095a0180c01a07e5c72769a4163efd9d98 (diff) | |
download | bcm5719-llvm-ed54b4a7985000624229f2375233eb3c6a9b23fc.tar.gz bcm5719-llvm-ed54b4a7985000624229f2375233eb3c6a9b23fc.zip |
Add a "probe-stack" attribute
This attribute is used to ensure the guard page is triggered on stack
overflow. Stack frames larger than the guard page size will generate
a call to __probestack to touch each page so the guard page won't
be skipped.
Reviewed By: majnemer
Differential Revision: https://reviews.llvm.org/D34386
llvm-svn: 305939
Diffstat (limited to 'llvm/test/Transforms/Inline/inline-probe-stack.ll')
-rw-r--r-- | llvm/test/Transforms/Inline/inline-probe-stack.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/inline-probe-stack.ll b/llvm/test/Transforms/Inline/inline-probe-stack.ll new file mode 100644 index 00000000000..bddee16d30b --- /dev/null +++ b/llvm/test/Transforms/Inline/inline-probe-stack.ll @@ -0,0 +1,20 @@ +; RUN: opt %s -inline -S | FileCheck %s + +define internal void @inner() "probe-stack"="__probestackinner" { + ret void +} + +define void @outerNoAttribute() { + call void @inner() + ret void +} + +define void @outerConflictingAttribute() "probe-stack"="__probestackouter" { + call void @inner() + ret void +} + +; CHECK: define void @outerNoAttribute() #0 +; CHECK: define void @outerConflictingAttribute() #1 +; CHECK: attributes #0 = { "probe-stack"="__probestackinner" } +; CHECK: attributes #1 = { "probe-stack"="__probestackouter" } |