The strreplace tool helps to eliminate test code duplication. For example the sample below checks 2 operations - add & sub - in the same test code, so you don't need to create 2 separate test files:
; RUN: strreplace '<OPER>' "add" < %s | strreplace "<OPER_ASM>" "addl" > %t.1
; RUN: llc -O0 < %t.1 -mtriple=i686-apple-darwin | FileCheck %t.1
; RUN: strreplace '<OPER>' "sub" < %s | strreplace "<OPER_ASM>" "subl" > %t.2
; RUN: llc < %t.2 -mtriple=i686-apple-darwin | FileCheck %t.2
; CHECK-LABEL: @foo_<OPER>
; CHECK: <OPER_ASM>
define i32 @foo_<OPER>(i32 %v).
{
%res = <OPER> i32 1234, %v
ret i32 %res
}