diff options
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/bad-operator-call.slang | 26 | ||||
| -rw-r--r-- | tests/diagnostics/bad-operator-call.slang.expected | 70 |
2 files changed, 13 insertions, 83 deletions
diff --git a/tests/diagnostics/bad-operator-call.slang b/tests/diagnostics/bad-operator-call.slang index 1455d1cc3..2764d27ae 100644 --- a/tests/diagnostics/bad-operator-call.slang +++ b/tests/diagnostics/bad-operator-call.slang @@ -1,6 +1,6 @@ // bad-operator-call.slang -//DIAGNOSTIC_TEST(windows):SIMPLE: +//DIAGNOSTIC_TEST(windows):SIMPLE(filecheck=CHECK): // Test that bad calls to operators produce reasonable diagnostic messages. @@ -13,22 +13,22 @@ struct S {} void test() { int a; - S b; - - a += b; - - a = a + b; - + S b; + // CHECK:{{.*}}.slang(18): error {{.*}}: no overload for '+=' applicable to arguments of type (int, S) + a += b; + // CHECK:{{.*}}.slang(20): error {{.*}}: no overload for '+' applicable to arguments of type (int, S) + a = a + b; + // CHECK:{{.*}}.slang(22): error {{.*}}: no overload for '~' applicable to arguments of type (S) a = ~b; vector<int, 4> c; - vector<float, 3> d; - + vector<float, 3> d; + // CHECK:{{.*}}.slang(27): error {{.*}}: argument passed to parameter '0' must be l-value. a += c; - c = a + c; - - d += c; - + c = a + c; + // CHECK:{{.*}}.slang(31): error {{.*}}: no overload for '+=' applicable to arguments of type (vector<float,3>, vector<int,4>) + d += c; + // CHECK:{{.*}}.slang(33): error {{.*}}: no overload for '+' applicable to arguments of type (vector<int,4>, vector<float,3>) d = c + d; }
\ No newline at end of file diff --git a/tests/diagnostics/bad-operator-call.slang.expected b/tests/diagnostics/bad-operator-call.slang.expected deleted file mode 100644 index 3abca8f23..000000000 --- a/tests/diagnostics/bad-operator-call.slang.expected +++ /dev/null @@ -1,70 +0,0 @@ -result code = -1 -standard error = { -tests/diagnostics/bad-operator-call.slang(18): error 39999: no overload for '+=' applicable to arguments of type (int, S) - a += b; - ^~ -core.meta.slang(2655): note 39999: candidate: func +=<T, R:int, C:int>(out matrix<T,R,C>, T) -> matrix<T,R,C> -core.meta.slang(2647): note 39999: candidate: func +=<T, R:int, C:int>(out matrix<T,R,C>, matrix<T,R,C>) -> matrix<T,R,C> -core.meta.slang(2639): note 39999: candidate: func +=<T, N:int>(out vector<T,N>, T) -> vector<T,N> -core.meta.slang(2631): note 39999: candidate: func +=<T, N:int>(out vector<T,N>, vector<T,N>) -> vector<T,N> -core.meta.slang(2623): note 39999: candidate: func +=<T>(out T, T) -> T -tests/diagnostics/bad-operator-call.slang(20): error 39999: no overload for '+' applicable to arguments of type (int, S) - a = a + b; - ^ -core.meta.slang(2481): note 39999: candidate: func +(uintptr_t, uintptr_t) -> uintptr_t -core.meta.slang(2473): note 39999: candidate: func +(uint64_t, uint64_t) -> uint64_t -core.meta.slang(2465): note 39999: candidate: func +(uint, uint) -> uint -core.meta.slang(2457): note 39999: candidate: func +(uint16_t, uint16_t) -> uint16_t -core.meta.slang(2449): note 39999: candidate: func +(uint8_t, uint8_t) -> uint8_t -core.meta.slang(2441): note 39999: candidate: func +(double, double) -> double -core.meta.slang(2433): note 39999: candidate: func +(float, float) -> float -core.meta.slang(2425): note 39999: candidate: func +(half, half) -> half -core.meta.slang(2417): note 39999: candidate: func +(intptr_t, intptr_t) -> intptr_t -core.meta.slang(2409): note 39999: candidate: func +(int64_t, int64_t) -> int64_t -tests/diagnostics/bad-operator-call.slang(20): note 39999: 3 more overload candidates - a = a + b; - ^ -tests/diagnostics/bad-operator-call.slang(22): error 39999: no overload for '~' applicable to arguments of type (S) - a = ~b; - ^ -core.meta.slang(2350): note 39999: candidate: __prefix func ~(uintptr_t) -> uintptr_t -core.meta.slang(2346): note 39999: candidate: __prefix func ~(uint64_t) -> uint64_t -core.meta.slang(2342): note 39999: candidate: __prefix func ~(uint) -> uint -core.meta.slang(2338): note 39999: candidate: __prefix func ~(uint16_t) -> uint16_t -core.meta.slang(2334): note 39999: candidate: __prefix func ~(uint8_t) -> uint8_t -core.meta.slang(2330): note 39999: candidate: __prefix func ~(intptr_t) -> intptr_t -core.meta.slang(2326): note 39999: candidate: __prefix func ~(int64_t) -> int64_t -core.meta.slang(2322): note 39999: candidate: __prefix func ~(int) -> int -core.meta.slang(2318): note 39999: candidate: __prefix func ~(int16_t) -> int16_t -core.meta.slang(2314): note 39999: candidate: __prefix func ~(int8_t) -> int8_t -tests/diagnostics/bad-operator-call.slang(27): error 30047: argument passed to parameter '0' must be l-value. - a += c; - ^ -tests/diagnostics/bad-operator-call.slang(27): note 30063: argument was implicitly cast from 'int' to 'vector<int,4>', and Slang does not support using an implicit cast as an l-value with this type -tests/diagnostics/bad-operator-call.slang(31): error 39999: no overload for '+=' applicable to arguments of type (vector<float,3>, vector<int,4>) - d += c; - ^~ -core.meta.slang(2655): note 39999: candidate: func +=<T, R:int, C:int>(out matrix<T,R,C>, T) -> matrix<T,R,C> -core.meta.slang(2647): note 39999: candidate: func +=<T, R:int, C:int>(out matrix<T,R,C>, matrix<T,R,C>) -> matrix<T,R,C> -core.meta.slang(2639): note 39999: candidate: func +=<T, N:int>(out vector<T,N>, T) -> vector<T,N> -core.meta.slang(2631): note 39999: candidate: func +=<T, N:int>(out vector<T,N>, vector<T,N>) -> vector<T,N> -core.meta.slang(2623): note 39999: candidate: func +=<T>(out T, T) -> T -tests/diagnostics/bad-operator-call.slang(33): error 39999: no overload for '+' applicable to arguments of type (vector<int,4>, vector<float,3>) - d = c + d; - ^ -core.meta.slang(2487): note 39999: candidate: func +<4>(uintptr_t4, uintptr_t) -> uintptr_t4 -core.meta.slang(2485): note 39999: candidate: func +<3>(uintptr_t, uintptr_t3) -> uintptr_t3 -core.meta.slang(2481): note 39999: candidate: func +(uintptr_t, uintptr_t) -> uintptr_t -core.meta.slang(2479): note 39999: candidate: func +<4>(uint64_t4, uint64_t) -> uint64_t4 -core.meta.slang(2477): note 39999: candidate: func +<3>(uint64_t, uint64_t3) -> uint64_t3 -core.meta.slang(2473): note 39999: candidate: func +(uint64_t, uint64_t) -> uint64_t -core.meta.slang(2471): note 39999: candidate: func +<4>(uint4, uint) -> uint4 -core.meta.slang(2469): note 39999: candidate: func +<3>(uint, uint3) -> uint3 -core.meta.slang(2465): note 39999: candidate: func +(uint, uint) -> uint -core.meta.slang(2463): note 39999: candidate: func +<4>(uint16_t4, uint16_t) -> uint16_t4 -tests/diagnostics/bad-operator-call.slang(33): note 39999: 29 more overload candidates - d = c + d; - ^ -} -standard output = { -} |
