[FunctionAttrs] Provide a mechanism for adding function attributes from the command...
[oota-llvm.git] / test / Transforms / FunctionAttrs / forced.ll
diff --git a/test/Transforms/FunctionAttrs/forced.ll b/test/Transforms/FunctionAttrs/forced.ll
new file mode 100644 (file)
index 0000000..d0bdb15
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: opt < %s -S -functionattrs | FileCheck %s --check-prefix=CHECK-CONTROL
+; RUN: opt < %s -S -functionattrs -force-attribute foo:noinline | FileCheck %s --check-prefix=CHECK-FOO
+
+; CHECK-CONTROL: define void @foo() #0 {
+; CHECK-FOO: define void @foo() #0 {
+define void @foo() {
+  ret void
+}
+
+
+; CHECK-CONTROL: attributes #0 = { norecurse readnone }
+; CHECK-FOO: attributes #0 = { noinline norecurse readnone }