summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ForcedFunctionAttrs/forced.ll
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-12-27 08:13:45 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-12-27 08:13:45 +0000
commitf49f1a87ef49150c33d0810b3e8b0d56e56f3d1f (patch)
tree188e517b88a15913e5dcfb59034e582281b34d5f /llvm/test/Transforms/ForcedFunctionAttrs/forced.ll
parent48a065d2eaba92c5c1221dc32810522b7aad6745 (diff)
downloadbcm5719-llvm-f49f1a87ef49150c33d0810b3e8b0d56e56f3d1f.tar.gz
bcm5719-llvm-f49f1a87ef49150c33d0810b3e8b0d56e56f3d1f.zip
[attrs] Split off the forced attributes utility into its own pass that
is (by default) run much earlier than FuncitonAttrs proper. This allows forcing optnone or other widely impactful attributes. It is also a bit simpler as the force attribute behavior needs no specific iteration order. I've added the pass into the default module pass pipeline and LTO pass pipeline which mirrors where function attrs itself was being run. Differential Revision: http://reviews.llvm.org/D15668 llvm-svn: 256465
Diffstat (limited to 'llvm/test/Transforms/ForcedFunctionAttrs/forced.ll')
-rw-r--r--llvm/test/Transforms/ForcedFunctionAttrs/forced.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ForcedFunctionAttrs/forced.ll b/llvm/test/Transforms/ForcedFunctionAttrs/forced.ll
new file mode 100644
index 00000000000..a41e9c0efbe
--- /dev/null
+++ b/llvm/test/Transforms/ForcedFunctionAttrs/forced.ll
@@ -0,0 +1,12 @@
+; RUN: opt < %s -S -forceattrs | FileCheck %s --check-prefix=CHECK-CONTROL
+; RUN: opt < %s -S -forceattrs -force-attribute foo:noinline | FileCheck %s --check-prefix=CHECK-FOO
+; RUN: opt < %s -S -passes=forceattrs -force-attribute foo:noinline | FileCheck %s --check-prefix=CHECK-FOO
+
+; CHECK-CONTROL: define void @foo() {
+; CHECK-FOO: define void @foo() #0 {
+define void @foo() {
+ ret void
+}
+
+
+; CHECK-FOO: attributes #0 = { noinline }
OpenPOWER on IntegriCloud