• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
7add r10, r1, r2
8add r11, r3, r4
9mul 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
24add r11, r1, r2
25xor r12, r1, r2
26add r10, r3, r4
27mul 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
43call void @foo(), !dbg !0
44call 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
62call void @foo(), !dbg !0
63call 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
81store i64 8, i64* %a
82store i64 4, i64* %a
83store i64 4, i64* %b
84store 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
100store i64 8, i64* %a
101store i64 4, i64* %a
102store i64 4, i64* %b
103store 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
1290: task_begin
1301: task_begin
1310: barrier_begin
1321: 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
167Assume we have DAGs, NOTs, DAGs, NOTs, and then DAGs.  Let X, Y, and Z be
168the DAG groups such that the leading DAGs are x, y, and z.  y won't match
169overlaps with matches from:
170
1711. X.  Otherwise, we used to get a spurious reordering complaint (back
172   when reordering complaints on DAG-NOT-DAG were still implemented).
1732. 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.
1763. z.  This follows by applying rule #1 for z instead of y.
177
178__DagNotDag
179abcdefgh
180abcd
181efgh
182
183abcd
184ab
185cd
186
187abcd
188cd
189ab
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