Debian Codegraph @

clang/test/SemaHLSL/BuiltIns/logical-mat-operator-errors.hlsl

raw
1 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=or
2 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify -DTEST_FUNC=and
3
4 bool2x2 test_mismatched_args(bool2x2 a, bool3x3 b)
5 {
6 return TEST_FUNC(a, b);
7 // expected-warning@-1 {{implicit conversion truncates matrix: 'bool3x3' (aka 'matrix<bool, 3, 3>') to 'matrix<bool, 2, 2>'}}
8 }
9
10 bool3x3 test_mismatched_args(bool3x3 a, bool2x2 b)
11 {
12 return TEST_FUNC(a, b);
13 // expected-error@-1 {{cannot initialize return object of type 'bool3x3' (aka 'matrix<bool, 3, 3>') with an rvalue of type 'matrix<bool, 2, 2>'}}
14 }
15
16 bool2x2 test_mismatched_args2(bool3x3 a, bool2x2 b)
17 {
18 return TEST_FUNC(a, b);
19 // expected-warning@-1 {{implicit conversion truncates matrix: 'bool3x3' (aka 'matrix<bool, 3, 3>') to 'matrix<bool, 2, 2>'}}
20 }
21
22 bool3x3 test_mismatched_return_larger(bool2x2 a, bool2x2 b)
23 {
24 return TEST_FUNC(a, b);
25 // expected-error@-1 {{cannot initialize return object of type 'matrix<[...], 3, 3>' with an rvalue of type 'matrix<[...], 2, 2>'}}
26 }
27
28 bool2x2 test_mismatched_return_smaller(bool3x3 a, bool3x3 b)
29 {
30 return TEST_FUNC(a, b);
31 // expected-warning@-1 {{implicit conversion truncates matrix: 'bool3x3' (aka 'matrix<bool, 3, 3>') to 'matrix<bool, 2, 2>'}}
32 }