File tree Expand file tree Collapse file tree 4 files changed +43
-1
lines changed
test/tools/UpdateTestChecks/update_test_checks Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change
1
+ ; Example input for update_test_checks (taken from test/Transforms/SLPVectorizer/extractlements-gathered-first-node.ll)
2
+ ; RUN: %if x86-registered-target %{ opt -S --passes=slp-vectorizer -slp-threshold=-99999 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s %}
3
+ ; RUN: %if aarch64-registered-target %{ opt -S --passes=slp-vectorizer -slp-threshold=-99999 -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s %}
4
+
5
+ define void @test () {
6
+ bb:
7
+ %0 = extractelement <4 x i32 > zeroinitializer , i32 0
8
+ %1 = extractelement <2 x i32 > zeroinitializer , i32 0
9
+ %icmp = icmp ult i32 %0 , %1
10
+ ret void
11
+ }
Original file line number Diff line number Diff line change
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2
+ ; Example input for update_test_checks (taken from test/Transforms/SLPVectorizer/extractlements-gathered-first-node.ll)
3
+ ; RUN: %if x86-registered-target %{ opt -S --passes=slp-vectorizer -slp-threshold=-99999 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s %}
4
+ ; RUN: %if aarch64-registered-target %{ opt -S --passes=slp-vectorizer -slp-threshold=-99999 -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s %}
5
+
6
+ define void @test() {
7
+ ; CHECK-LABEL: define void @test() {
8
+ ; CHECK-NEXT: bb:
9
+ ; CHECK-NEXT: [[TMP0:%.*]] = extractelement <4 x i32> zeroinitializer, i32 0
10
+ ; CHECK-NEXT: [[TMP1:%.*]] = extractelement <2 x i32> zeroinitializer, i32 0
11
+ ; CHECK-NEXT: [[ICMP:%.*]] = icmp ult i32 [[TMP0]], [[TMP1]]
12
+ ; CHECK-NEXT: ret void
13
+ ;
14
+ bb:
15
+ %0 = extractelement <4 x i32> zeroinitializer, i32 0
16
+ %1 = extractelement <2 x i32> zeroinitializer, i32 0
17
+ %icmp = icmp ult i32 %0, %1
18
+ ret void
19
+ }
Original file line number Diff line number Diff line change
1
+ ## Basic test checking that update_test_checks.py works correctly with %if in RUN line
2
+ # RUN: cp -f %S/Inputs/if_target.ll %t.ll && %update_test_checks %t.ll --version 4
3
+ # RUN: diff -u %t.ll %S/Inputs/if_target.ll.expected
4
+ ## Check that running the script again does not change the result:
5
+ # RUN: %update_test_checks %t.ll
6
+ # RUN: diff -u %t.ll %S/Inputs/if_target.ll.expected
Original file line number Diff line number Diff line change @@ -123,7 +123,13 @@ def main():
123
123
common .warn ("Skipping unparsable RUN line: " + l )
124
124
continue
125
125
126
- commands = [cmd .strip () for cmd in l .split ("|" )]
126
+ cropped_content = l
127
+ if "%if" in l :
128
+ match = re .search (r"%{\s*(.*?)\s*%}" , l )
129
+ if match :
130
+ cropped_content = match .group (1 )
131
+
132
+ commands = [cmd .strip () for cmd in cropped_content .split ("|" )]
127
133
assert len (commands ) >= 2
128
134
preprocess_cmd = None
129
135
if len (commands ) > 2 :
You can’t perform that action at this time.
0 commit comments