https://bugs.llvm.org/show_bug.cgi?id=42896

            Bug ID: 42896
           Summary: Using variable defined from expression on the same
                    line can fail
           Product: Test Suite
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: lit
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

The following testcase fails:

RUN: FileCheck --input-file %s %s

FOO=67
BAR=68
BAR=69, BAZ:70
CHECK: FOO=[[#FOO:]]
CHECK: BAR=[[#BAR:FOO+1]]
CHECK: BAR=[[#BAR:FOO+2]], BAZ:[[#BAR+1]]


This is due to the commit r365220 which changes the use of
FileCheckNumericVariable to have only one instance per variable rather than one
instance per variable definition as previously. The two definitions of BAR
above thus share the same expression: FOO+1. Substitution works fine because it
does not get the expression from the variable. However setting the first value
of BAR will clear the expression, leading the evaluation of BAR+1 to consider
BAR as being undefined because its expression is null and thus it cannot
evaluate BAR.

I am working on a patch to solve this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to