[PATCH] [TOOL][TEST] A simple string replacing tool for testing purposes

hfinkel at anl.gov hfinkel at anl.gov
Fri Sep 19 15:34:10 PDT 2014


I don't think this is the right approach because it encourages multiple invocations of the executables, but this adds a lot of overhead to the test-suite run time. We generally encourage placing as many related tests together in the same file as possible to reduce this overhead. Also, it moves logic (like ADD -> some_add_instruction) into the command line and away from the relevant part of the test.

If you're looking for a simple way to capture this, I recommend that we provide a way to repeat a part of the file multiple times, and each time, have the ability to provide alternates. I'm thinking of something like this (obviously the syntax could use some improvement, but I think you'll get the idea):

  RUN: repeater %s > %t.all
  RUN: llc < %t.all | FileCheck %t.all

  ; FOREACH ADD SUB
  ; DEFINE OPER <ADD: add, SUB: sub>
  ; CHECK-LABEL: @foo_<OPER>
  ; CHECK: <ADD: addl, SUB: subl>

  define i32 @foo_<OPER>(i32 %v).
  {
    %res = <OPER> i32 1234, %v
    ret i32 %res
  }
  ; ENDFOREACH

http://reviews.llvm.org/D5331






More information about the llvm-commits mailing list