Files
llvm-project/llvm/test/Transforms/FunctionAttrs/forced.ll
James Molloy 0ecdbe7d6b [FunctionAttrs] Provide a mechanism for adding function attributes from the command line
This provides a way to force a function to have certain attributes from the command line. This can be useful when debugging or doing workload exploration, where manually editing IR is tedious or not possible (due to build systems etc).

The syntax is -force-attribute=function_name:attribute_name

All function attributes are parsed except alignstack as it requires an argument.

llvm-svn: 253550
2015-11-19 08:49:57 +00:00

13 lines
414 B
LLVM

; 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 }