<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - FileCheck .* is too greedy"
   href="https://llvm.org/bugs/show_bug.cgi?id=30198">30198</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FileCheck .* is too greedy
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Test Suite
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>lit
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>paul_robinson@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>daniel@zuster.org, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In r280057, Richard Smith made this change to a test:

--- cfe/trunk/test/Driver/modules-ts.cpp (original)
+++ cfe/trunk/test/Driver/modules-ts.cpp Tue Aug 30 00:14:38 2016
@@ -23,8 +23,7 @@
 // CHECK-USE: -cc1
 // CHECK-USE-SAME: -emit-obj
 // CHECK-USE-SAME: -fmodule-file={{.*}}.pcm
-// CHECK-USE-SAME: -o {{.*}}.o
-// CHECK-USE-SAME: -x c++
+// CHECK-USE-SAME: -o {{.*}}.o {{.*}}-x c++
 // CHECK-USE-SAME: modules-ts.cpp


The reason is that the {{.*}}.o was matching too much text, and
indeed the following test case fails:

$ cat foo.txt
CHECK:  -o {{.*}}.o
CHECK-SAME: -x c++
$ echo '-o blah.o -x c++ llvm.org' | FileCheck foo.txt
foo.txt:2:13: error: expected string not found in input
CHECK-SAME: -x c++
            ^
<stdin>:1:24: note: scanning from here
-o blah.o -x c++ llvm.org
                       ^


I think FileCheck's '*' regex operator should not be greedy,
i.e. match the minimum necessary not the maximum.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>