Skip to content

Commit 7822a5d

Browse files
committed
add tests
1 parent 27f8aad commit 7822a5d

File tree

6 files changed

+175
-4
lines changed

6 files changed

+175
-4
lines changed

llvm/test/CodeGen/MIR/AArch64/parse-low-level-type-invalid0.mir

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,30 @@ body: |
88
; CHECK: [[@LINE+1]]:10: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
99
%0:_(s) = COPY $x0
1010
...
11+
12+
---
13+
name: test_low_level_type_is_single_i_p
14+
body: |
15+
bb.0:
16+
liveins: $x0
17+
; CHECK: [[@LINE+1]]:10: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
18+
%0:_(i) = COPY $x0
19+
...
20+
21+
---
22+
name: test_low_level_type_is_single_f_p
23+
body: |
24+
bb.0:
25+
liveins: $x0
26+
; CHECK: [[@LINE+1]]:10: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
27+
%0:_(f) = COPY $x0
28+
...
29+
30+
---
31+
name: test_low_level_type_is_single_bf_p
32+
body: |
33+
bb.0:
34+
liveins: $x0
35+
; CHECK: [[@LINE+1]]:10: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
36+
%0:_(bf) = COPY $x0
37+
...

llvm/test/CodeGen/MIR/AArch64/parse-low-level-type-invalid2.mir

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,39 @@ body: |
88
; CHECK: [[@LINE+1]]:15: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
99
%0:_(<2 x p>) = COPY $q0
1010
...
11+
12+
---
13+
name: test_low_level_type_is_single_s_s
14+
body: |
15+
bb.0:
16+
liveins: $q0
17+
; CHECK: [[@LINE+1]]:15: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
18+
%0:_(<2 x s>) = COPY $q0
19+
...
20+
21+
---
22+
name: test_low_level_type_is_single_s_i
23+
body: |
24+
bb.0:
25+
liveins: $q0
26+
; CHECK: [[@LINE+1]]:15: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
27+
%0:_(<2 x i>) = COPY $q0
28+
...
29+
30+
---
31+
name: test_low_level_type_is_single_s_f
32+
body: |
33+
bb.0:
34+
liveins: $q0
35+
; CHECK: [[@LINE+1]]:15: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
36+
%0:_(<2 x f>) = COPY $q0
37+
...
38+
39+
---
40+
name: test_low_level_type_is_single_s_bf
41+
body: |
42+
bb.0:
43+
liveins: $q0
44+
; CHECK: [[@LINE+1]]:15: expected integers after 's'/'i'/'f'/'bf'/'p' type identifier
45+
%0:_(<2 x bf>) = COPY $q0
46+
...
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
# RUN: not llc -mtriple=aarch64-- -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
22
# When a low-level type is larger than supported
33
---
4-
name: test_scalar_size_65536
4+
name: test_scalar_size_65536_s
55
body: |
66
bb.0:
77
liveins: $x0
88
; CHECK: [[@LINE+1]]:10: invalid size for scalar type
99
%0:_(s65536) = G_IMPLICIT_DEF
1010
...
11+
12+
---
13+
name: test_scalar_size_65536_i
14+
body: |
15+
bb.0:
16+
liveins: $x0
17+
; CHECK: [[@LINE+1]]:10: invalid size for scalar type
18+
%0:_(s65536) = G_IMPLICIT_DEF
19+
...
20+
21+
---
22+
name: test_scalar_size_65536_f
23+
body: |
24+
bb.0:
25+
liveins: $x0
26+
; CHECK: [[@LINE+1]]:10: invalid size for scalar type
27+
%0:_(f65536) = G_IMPLICIT_DEF
28+
...
29+
30+
---
31+
name: test_scalar_size_65536_bf
32+
body: |
33+
bb.0:
34+
liveins: $x0
35+
; CHECK: [[@LINE+1]]:10: invalid size for scalar type
36+
%0:_(bf65536) = G_IMPLICIT_DEF
37+
...
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
# RUN: not llc -mtriple=aarch64-- -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
22
# When a low-level type vector has a 0-bit element
33
---
4-
name: test_vector_element_size_0
4+
name: test_vector_element_size_0_s
55
body: |
66
bb.0:
77
liveins: $x0
88
; CHECK: [[@LINE+1]]:15: invalid size for scalar element in vector
99
%0:_(<2 x s0>) = G_IMPLICIT_DEF
1010
...
11+
12+
---
13+
name: test_vector_element_size_0_s
14+
body: |
15+
bb.0:
16+
liveins: $x0
17+
; CHECK: [[@LINE+1]]:15: invalid size for scalar element in vector
18+
%0:_(<2 x s0>) = G_IMPLICIT_DEF
19+
...
20+
21+
---
22+
name: test_vector_element_size_0_f
23+
body: |
24+
bb.0:
25+
liveins: $x0
26+
; CHECK: [[@LINE+1]]:15: invalid size for scalar element in vector
27+
%0:_(<2 x f0>) = G_IMPLICIT_DEF
28+
...
29+
30+
---
31+
name: test_vector_element_size_bf
32+
body: |
33+
bb.0:
34+
liveins: $x0
35+
; CHECK: [[@LINE+1]]:15: invalid size for scalar element in vector
36+
%0:_(<2 x bf0>) = G_IMPLICIT_DEF
37+
...
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
# RUN: not llc -mtriple=aarch64-- -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
22
# When a low-level type vector has 0 elements
33
---
4-
name: test_vector_0_elements
4+
name: test_vector_0_elements_s
55
body: |
66
bb.0:
77
liveins: $x0
88
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
99
%0:_(<0 x s1>) = G_IMPLICIT_DEF
1010
...
11+
12+
---
13+
name: test_vector_0_elements_i
14+
body: |
15+
bb.0:
16+
liveins: $x0
17+
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
18+
%0:_(<0 x i1>) = G_IMPLICIT_DEF
19+
...
20+
21+
---
22+
name: test_vector_0_elements_f
23+
body: |
24+
bb.0:
25+
liveins: $x0
26+
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
27+
%0:_(<0 x f32>) = G_IMPLICIT_DEF
28+
...
29+
30+
---
31+
name: test_vector_0_elements_bf
32+
body: |
33+
bb.0:
34+
liveins: $x0
35+
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
36+
%0:_(<0 x bf16>) = G_IMPLICIT_DEF
37+
...
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
# RUN: not llc -mtriple=aarch64-- -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
22
# When a low-level type vector has more elements than supported
33
---
4-
name: test_vector_too_many_elements
4+
name: test_vector_too_many_elements_s
55
body: |
66
bb.0:
77
liveins: $x0
88
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
99
%0:_(<65536 x s1>) = G_IMPLICIT_DEF
1010
...
11+
12+
---
13+
name: test_vector_too_many_elements_i
14+
body: |
15+
bb.0:
16+
liveins: $x0
17+
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
18+
%0:_(<65536 x i1>) = G_IMPLICIT_DEF
19+
...
20+
21+
---
22+
name: test_vector_too_many_elements_f
23+
body: |
24+
bb.0:
25+
liveins: $x0
26+
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
27+
%0:_(<65536 x f32>) = G_IMPLICIT_DEF
28+
...
29+
30+
---
31+
name: test_vector_too_many_elements_bf
32+
body: |
33+
bb.0:
34+
liveins: $x0
35+
; CHECK: [[@LINE+1]]:11: invalid number of vector elements
36+
%0:_(<65536 x b16>) = G_IMPLICIT_DEF
37+
...

0 commit comments

Comments
 (0)