Home | History | Annotate | Download | only in FileCheck
      1 ;---------------------------------------------------------------------
      2 ; RUN: not FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
      3 ; RUN:               -check-prefix=IdentPat
      4 ; RUN: FileCheck -input-file %s %s -check-prefix=IdentPat
      5 
      6 __IdentPat
      7 add r10, r1, r2
      8 add r11, r3, r4
      9 mul r5, r10, r11
     10 __IdentPat
     11 
     12 ; IdentPat:     {{^}}__IdentPat
     13 ; IdentPat-DAG: {{^}}add [[REG1:r[0-9]+]], {{r[0-9]+}}, {{r[0-9]+}}
     14 ; IdentPat-DAG: {{^}}add [[REG2:r[0-9]+]], {{r[0-9]+}}, {{r[0-9]+}}
     15 ; IdentPat:     {{^}}mul r5, [[REG1]], [[REG2]]
     16 ; IdentPat:     {{^}}__IdentPat
     17 
     18 ;---------------------------------------------------------------------
     19 ; RUN: not FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
     20 ; RUN:               -check-prefix=IdentPatNot
     21 ; RUN: FileCheck -input-file %s %s -check-prefix=IdentPatNot
     22 
     23 __IdentPatNot
     24 add r11, r1, r2
     25 xor r12, r1, r2
     26 add r10, r3, r4
     27 mul r5, r10, r11
     28 __IdentPatNot
     29 
     30 ; IdentPatNot:     {{^}}__IdentPatNot
     31 ; IdentPatNot-DAG: {{^}}add {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}
     32 ; IdentPatNot-DAG: {{^}}add {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}
     33 ; IdentPatNot-NOT: {{^}}xor
     34 ; IdentPatNot-DAG: {{^}}mul r5, r10, r11
     35 ; IdentPatNot:     {{^}}__IdentPatNot
     36 
     37 ;---------------------------------------------------------------------
     38 ; RUN: FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
     39 ; RUN:           -check-prefix=IdentPatVarDiff
     40 ; RUN: FileCheck -input-file %s %s -check-prefix=IdentPatVarDiff
     41 
     42 __IdentPatVarDiff
     43 call void @foo(), !dbg !0
     44 call void @bar(), !dbg !1
     45 !1 = !DILocation(line: 1,
     46 !0 = !DILocation(line: 1,
     47 __IdentPatVarDiff
     48 
     49 ; IdentPatVarDiff:     {{^}}__IdentPatVarDiff
     50 ; IdentPatVarDiff:     {{^}}call void @foo(), !dbg [[DBG0:![0-9]+]]
     51 ; IdentPatVarDiff:     {{^}}call void @bar(), !dbg [[DBG1:![0-9]+]]
     52 ; IdentPatVarDiff-DAG: {{^}}[[DBG0]] = !DILocation(line: 1,
     53 ; IdentPatVarDiff-DAG: {{^}}[[DBG1]] = !DILocation(line: 1,
     54 ; IdentPatVarDiff:     {{^}}__IdentPatVarDiff
     55 
     56 ;---------------------------------------------------------------------
     57 ; RUN: FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
     58 ; RUN:           -check-prefix=IdentPatVarSame
     59 ; RUN: not FileCheck -input-file %s %s -check-prefix=IdentPatVarSame
     60 
     61 __IdentPatVarSame
     62 call void @foo(), !dbg !0
     63 call void @bar(), !dbg !0
     64 !1 = !DILocation(line: 1,
     65 !0 = !DILocation(line: 1,
     66 __IdentPatVarSame
     67 
     68 ; IdentPatVarSame:     {{^}}__IdentPatVarSame
     69 ; IdentPatVarSame:     {{^}}call void @foo(), !dbg [[DBG0:![0-9]+]]
     70 ; IdentPatVarSame:     {{^}}call void @bar(), !dbg [[DBG1:![0-9]+]]
     71 ; IdentPatVarSame-DAG: {{^}}[[DBG0]] = !DILocation(line: 1,
     72 ; IdentPatVarSame-DAG: {{^}}[[DBG1]] = !DILocation(line: 1,
     73 ; IdentPatVarSame:     {{^}}__IdentPatVarSame
     74 
     75 ;---------------------------------------------------------------------
     76 ; RUN: FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
     77 ; RUN:           -check-prefix=SupSubSet
     78 ; RUN: not FileCheck -input-file %s %s -check-prefix=SupSubSet
     79 
     80 __SupSubSet
     81 store i64 8, i64* %a
     82 store i64 4, i64* %a
     83 store i64 4, i64* %b
     84 store i64 8, i64* %b
     85 __SupSubSet
     86 
     87 ; SupSubSet:     {{^}}__SupSubSet
     88 ; SupSubSet-DAG: {{^}}store i64 {{4|8}}, i64* %a
     89 ; SupSubSet-DAG: {{^}}store i64 4, i64* %a
     90 ; SupSubSet-DAG: {{^}}store i64 {{4|8}}, i64* %b
     91 ; SupSubSet-DAG: {{^}}store i64 4, i64* %b
     92 ; SupSubSet:     {{^}}__SupSubSet
     93 
     94 ;---------------------------------------------------------------------
     95 ; RUN: FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
     96 ; RUN:           -check-prefix=SubSupSet
     97 ; RUN: FileCheck -input-file %s %s -check-prefix=SubSupSet
     98 
     99 __SubSupSet
    100 store i64 8, i64* %a
    101 store i64 4, i64* %a
    102 store i64 4, i64* %b
    103 store i64 8, i64* %b
    104 __SubSupSet
    105 
    106 ; SubSupSet:     {{^}}__SubSupSet
    107 ; SubSupSet-DAG: {{^}}store i64 4, i64* %a
    108 ; SubSupSet-DAG: {{^}}store i64 {{4|8}}, i64* %a
    109 ; SubSupSet-DAG: {{^}}store i64 4, i64* %b
    110 ; SubSupSet-DAG: {{^}}store i64 {{4|8}}, i64* %b
    111 ; SubSupSet:     {{^}}__SubSupSet
    112 
    113 ;---------------------------------------------------------------------
    114 ; RUN: not FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
    115 ; RUN:               -check-prefixes=WrongNumReps
    116 ; RUN: not FileCheck -input-file %s %s -check-prefixes=WrongNumReps
    117 ;
    118 ; RUN: not FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
    119 ; RUN:               -check-prefixes=WrongNumReps,WrongNumReps2
    120 ; RUN: FileCheck -input-file %s %s \
    121 ; RUN:           -check-prefixes=WrongNumReps,WrongNumReps2
    122 ;
    123 ; RUN: not FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
    124 ; RUN:               -check-prefixes=WrongNumReps,WrongNumReps2,WrongNumReps3
    125 ; RUN: not FileCheck -input-file %s %s \
    126 ; RUN:               -check-prefixes=WrongNumReps,WrongNumReps2,WrongNumReps3
    127 
    128 __WrongNumReps
    129 0: task_begin
    130 1: task_begin
    131 0: barrier_begin
    132 1: barrier_begin
    133 __WrongNumReps
    134 
    135 ; WrongNumReps:      {{^}}__WrongNumReps
    136 ; WrongNumReps-DAG:  {{^}}[[THID:[0-9]+]]: task_begin
    137 ; WrongNumReps-DAG:  {{^}}[[THID]]: barrier_begin
    138 ; WrongNumReps2-DAG: {{^}}[[THID:[0-9]+]]: task_begin
    139 ; WrongNumReps2-DAG: {{^}}[[THID]]: barrier_begin
    140 ; WrongNumReps3-DAG: {{^}}[[THID:[0-9]+]]: task_begin
    141 ; WrongNumReps3-DAG: {{^}}[[THID]]: barrier_begin
    142 ; WrongNumReps-NEXT: {{^}}__WrongNumReps
    143 
    144 ;---------------------------------------------------------------------
    145 ; RUN: not FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
    146 ; RUN:               -check-prefix=SameSimple
    147 ; RUN: FileCheck -input-file %s %s -check-prefix=SameSimple
    148 
    149 __SameSimple
    150 (<foo><bar><foo>)
    151 __SameSimple
    152 
    153 ; SameSimple:      {{^}}__SameSimple
    154 ; SameSimple:      {{^}}(
    155 ; SameSimple-DAG:  <foo>
    156 ; SameSimple-DAG:  <foo>
    157 ; SameSimple-DAG:  <bar>
    158 ; SameSimple-NOT:  <foo>
    159 ; SameSimple-SAME: ){{$}}
    160 ; SameSimple:      {{^}}__SameSimple
    161 
    162 ;---------------------------------------------------------------------
    163 ; RUN: not FileCheck -allow-deprecated-dag-overlap -input-file %s %s \
    164 ; RUN:               -check-prefix=DagNotDag
    165 ; RUN: FileCheck -input-file %s %s -check-prefix=DagNotDag
    166 
    167 Assume we have DAGs, NOTs, DAGs, NOTs, and then DAGs.  Let X, Y, and Z be
    168 the DAG groups such that the leading DAGs are x, y, and z.  y won't match
    169 overlaps with matches from:
    170 
    171 1. X.  Otherwise, we used to get a spurious reordering complaint (back
    172    when reordering complaints on DAG-NOT-DAG were still implemented).
    173 2. Y, because y is in Y.  To prevent these overlaps, the implementation must be
    174    careful not to drop y's match from the previous matches list when it drops
    175    matches from X to save search time.
    176 3. z.  This follows by applying rule #1 for z instead of y.
    177 
    178 __DagNotDag
    179 abcdefgh
    180 abcd
    181 efgh
    182 
    183 abcd
    184 ab
    185 cd
    186 
    187 abcd
    188 cd
    189 ab
    190 __DagNotDag
    191 
    192 ; DagNotDag:     {{^}}__DagNotDag
    193 ;
    194 ; X:
    195 ;   x:DagNotDag-DAG: {{^}}abcdefgh
    196 ;     DagNotDag-DAG: {{^}}abcd
    197 ;     DagNotDag-DAG: efgh{{$}}
    198 ;
    199 ; Reordering complaint if rule #1 is broken.
    200 ; DagNotDag-NOT: abcd
    201 ; DagNotDag-NOT: efgh
    202 ;
    203 ; Y:
    204 ;   y:DagNotDag-DAG: {{^}}abcd
    205 ;     DagNotDag-DAG: {{^}}ab
    206 ;     DagNotDag-DAG: cd{{$}}
    207 ;
    208 ; Matches if rule #2 is broken.
    209 ; DagNotDag-NOT: ab
    210 ; DagNotDag-NOT: cd
    211 ;
    212 ; Z:
    213 ;   z:DagNotDag-DAG: {{^}}abcd
    214 ;     DagNotDag-DAG: {{^}}ab
    215 ;     DagNotDag-DAG: cd{{$}}
    216 ;
    217 ; Matches if rule #3 is broken.
    218 ; DagNotDag-NOT: {{^}}ab
    219 ; DagNotDag-NOT: {{^}}cd
    220 ;
    221 ; DagNotDag:     {{^}}__DagNotDag
    222