|
1 |
| -// RUN: %clang_cc1 -HV 2021 -Wno-unused-value -fsyntax-only -ffreestanding -verify -verify-ignore-unexpected=note %s |
| 1 | +// RUN: %clang_cc1 -HV 2021 -Wno-unused-value -fsyntax-only -ffreestanding -verify %s |
2 | 2 |
|
3 | 3 | // Tests all implicit conversions and explicit casts between type shapes
|
4 | 4 | // (scalars, vectors, matrices, arrays and structs).
|
@@ -26,22 +26,99 @@ struct DerivedFrom_S2 : S2 {
|
26 | 26 | int c;
|
27 | 27 | };
|
28 | 28 |
|
29 |
| -// Clang generates a bunch of "notes" about overload candidates here, but we're not testing for these |
| 29 | +// Clang generates a bunch of "notes" about overload candidates here, we're not testing for these |
| 30 | +// Just avoid use -verify-ignore-unexpected. |
| 31 | + |
| 32 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'A1' (aka 'int [1]') to 'int' for 1st argument}} |
| 33 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'S1' to 'int' for 1st argument}} |
| 34 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'int' for 1st argument}} |
| 35 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S2' to 'int' for 1st argument}} |
30 | 36 | void to_i(int i) {}
|
| 37 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'int1' for 1st argument}} |
| 38 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'S2' to 'int1' for 1st argument}} |
| 39 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A1' (aka 'int [1]') to 'int1' for 1st argument}} |
| 40 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S1' to 'int1' for 1st argument}} |
31 | 41 | void to_v1(int1 v) {}
|
| 42 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'int2' for 1st argument}} |
| 43 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'S2' to 'int2' for 1st argument}} |
| 44 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A4' (aka 'int [4]') to 'int2' for 1st argument}} |
| 45 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S4' to 'int2' for 1st argument}} |
32 | 46 | void to_v2(int2 v) {}
|
33 | 47 | void to_v4(int4 v) {}
|
| 48 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'A1' (aka 'int [1]') to 'int1x1' for 1st argument}} |
| 49 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'S1' to 'int1x1' for 1st argument}} |
| 50 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'int1x1' for 1st argument}} |
| 51 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S2' to 'int1x1' for 1st argument}} |
34 | 52 | void to_m1x1(int1x1 m) {}
|
| 53 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'int1x2' for 1st argument}} |
| 54 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'S2' to 'int1x2' for 1st argument}} |
| 55 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A4' (aka 'int [4]') to 'int1x2' for 1st argument}} |
| 56 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S4' to 'int1x2' for 1st argument}} |
35 | 57 | void to_m1x2(int1x2 m) {}
|
| 58 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'S4' to 'int2x1' for 1st argument}} |
| 59 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'A4' (aka 'int [4]') to 'int2x1' for 1st argument}} |
| 60 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'S2' to 'int2x1' for 1st argument}} |
| 61 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'int2x1' for 1st argument}} |
36 | 62 | void to_m2x1(int2x1 m) {}
|
| 63 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'S5' to 'int2x2' for 1st argument}} |
| 64 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'A5' (aka 'int [5]') to 'int2x2' for 1st argument}} |
| 65 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'S4' to 'int2x2' for 1st argument}} |
| 66 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'A4' (aka 'int [4]') to 'int2x2' for 1st argument}} |
37 | 67 | void to_m2x2(int2x2 m) {}
|
38 | 68 | void to_m3x3(int3x3 m) {}
|
| 69 | +// expected-note@+8 {{candidate function not viable: no known conversion from 'int' to 'A1' (aka 'int [1]') for 1st argument}} |
| 70 | +// expected-note@+7 {{candidate function not viable: no known conversion from 'int1' to 'A1' (aka 'int [1]') for 1st argument}} |
| 71 | +// expected-note@+6 {{candidate function not viable: no known conversion from 'int1x1' to 'A1' (aka 'int [1]') for 1st argument}} |
| 72 | +// expected-note@+5 {{candidate function not viable: no known conversion from 'S1' to 'A1' (aka 'int [1]') for 1st argument}} |
| 73 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'int2' to 'A1' (aka 'int [1]') for 1st argument}} |
| 74 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'int2x2' to 'A1' (aka 'int [1]') for 1st argument}} |
| 75 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'A1' (aka 'int [1]') for 1st argument}} |
| 76 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S2' to 'A1' (aka 'int [1]') for 1st argument}} |
39 | 77 | void to_a1(A1 a) {}
|
| 78 | +// expected-note@+14 {{candidate function not viable: no known conversion from 'int' to 'A2' (aka 'int [2]') for 1st argument}} |
| 79 | +// expected-note@+13 {{candidate function not viable: no known conversion from 'int1' to 'A2' (aka 'int [2]') for 1st argument}} |
| 80 | +// expected-note@+12 {{candidate function not viable: no known conversion from 'int1x1' to 'A2' (aka 'int [2]') for 1st argument}} |
| 81 | +// expected-note@+11 {{candidate function not viable: no known conversion from 'int2' to 'A2' (aka 'int [2]') for 1st argument}} |
| 82 | +// expected-note@+10 {{candidate function not viable: no known conversion from 'int1x2' to 'A2' (aka 'int [2]') for 1st argument}} |
| 83 | +// expected-note@+9 {{candidate function not viable: no known conversion from 'int2x1' to 'A2' (aka 'int [2]') for 1st argument}} |
| 84 | +// expected-note@+8 {{candidate function not viable: no known conversion from 'S2' to 'A2' (aka 'int [2]') for 1st argument}} |
| 85 | +// expected-note@+7 {{candidate function not viable: no known conversion from 'int4' to 'A2' (aka 'int [2]') for 1st argument}} |
| 86 | +// expected-note@+6 {{candidate function not viable: no known conversion from 'int1x3' to 'A2' (aka 'int [2]') for 1st argument}} |
| 87 | +// expected-note@+5 {{candidate function not viable: no known conversion from 'int3x1' to 'A2' (aka 'int [2]') for 1st argument}} |
| 88 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'int2x2' to 'A2' (aka 'int [2]') for 1st argument}} |
| 89 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'int3x3' to 'A2' (aka 'int [2]') for 1st argument}} |
| 90 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A4' (aka 'int [4]') to 'A2' (aka 'int [2]') for 1st argument}} |
| 91 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S4' to 'A2' (aka 'int [2]') for 1st argument}} |
40 | 92 | void to_a2(A2 a) {}
|
| 93 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'int2x2' to 'A4' (aka 'int [4]') for 1st argument}} |
41 | 94 | void to_a4(A4 a) {}
|
42 | 95 | void to_a5(A5 a) {}
|
| 96 | +// expected-note@+8 {{candidate function not viable: no known conversion from 'int' to 'S1' for 1st argument}} |
| 97 | +// expected-note@+7 {{candidate function not viable: no known conversion from 'int1' to 'S1' for 1st argument}} |
| 98 | +// expected-note@+6 {{candidate function not viable: no known conversion from 'int1x1' to 'S1' for 1st argument}} |
| 99 | +// expected-note@+5 {{candidate function not viable: no known conversion from 'A1' (aka 'int [1]') to 'S1' for 1st argument}} |
| 100 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'int2' to 'S1' for 1st argument}} |
| 101 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'int2x2' to 'S1' for 1st argument}} |
| 102 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'S1' for 1st argument}} |
| 103 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S2' to 'S1' for 1st argument}} |
43 | 104 | void to_s1(S1 s) {}
|
| 105 | +// expected-note@+15 {{candidate function not viable: no known conversion from 'int' to 'S2' for 1st argument}} |
| 106 | +// expected-note@+14 {{candidate function not viable: no known conversion from 'int1' to 'S2' for 1st argument}} |
| 107 | +// expected-note@+13 {{candidate function not viable: no known conversion from 'int1x1' to 'S2' for 1st argument}} |
| 108 | +// expected-note@+12 {{candidate function not viable: no known conversion from 'int2' to 'S2' for 1st argument}} |
| 109 | +// expected-note@+11 {{candidate function not viable: no known conversion from 'int1x2' to 'S2' for 1st argument}} |
| 110 | +// expected-note@+10 {{candidate function not viable: no known conversion from 'int2x1' to 'S2' for 1st argument}} |
| 111 | +// expected-note@+9 {{candidate function not viable: no known conversion from 'A2' (aka 'int [2]') to 'S2' for 1st argument}} |
| 112 | +// expected-note@+8 {{candidate function not viable: no known conversion from 'Like_S2' to 'S2' for 1st argument}} |
| 113 | +// expected-note@+7 {{candidate function not viable: no known conversion from 'int4' to 'S2' for 1st argument}} |
| 114 | +// expected-note@+6 {{candidate function not viable: no known conversion from 'int1x3' to 'S2' for 1st argument}} |
| 115 | +// expected-note@+5 {{candidate function not viable: no known conversion from 'int3x1' to 'S2' for 1st argument}} |
| 116 | +// expected-note@+4 {{candidate function not viable: no known conversion from 'int2x2' to 'S2' for 1st argument}} |
| 117 | +// expected-note@+3 {{candidate function not viable: no known conversion from 'int3x3' to 'S2' for 1st argument}} |
| 118 | +// expected-note@+2 {{candidate function not viable: no known conversion from 'A4' (aka 'int [4]') to 'S2' for 1st argument}} |
| 119 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'S4' to 'S2' for 1st argument}} |
44 | 120 | void to_s2(S2 s) {}
|
| 121 | +// expected-note@+1 {{candidate function not viable: no known conversion from 'int2x2' to 'S4' for 1st argument}} |
45 | 122 | void to_s4(S4 s) {}
|
46 | 123 | void to_s5(S5 s) {}
|
47 | 124 |
|
|
0 commit comments