Skip to content

FileCheck: strange regexp match behavior on CFI tests #165899

@Mephistophiles

Description

@Mephistophiles

I encountered CFI test failures in tests similar to compiler-rt/test/cfi/multiple-inheritance.cpp when using a libc implementation that outputs additional debug information.

The issue occurs with FileCheck patterns like:

// RUN: FileCheck -check-prefix=CFI -input-file %s %s
Some string 12
1

CFI: 1
CFI-NOT: {{^2$}}

This test fails, but if 1 is replaced with {{^1$}}, it passes.

Expected Behavior:

  • CFI: 1 should match the digit 1 on owns line
  • CFI-NOT: {{^2$}} should not find 2 (because in this test there is no string that contains only '2')

Current Behavior:

  • CFI-NOT: {{^2$}} pattern incorrectly matches, suggesting that after matching 1.

Questions:

  • Is this the expected behavior of FileCheck?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions