318da83bdb
Previously, we allowed unary minus on numbers and vectors (of any type). Now, we allow them on numbers and vectors of numbers. Also updated the Boolean arithmetic error test to cover scalars as well as vectors. Change-Id: Ie74d1f3bfc1e9353e04c6f8e468fa20e0cbba16f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338396 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
56 lines
2.1 KiB
Plaintext
56 lines
2.1 KiB
Plaintext
bool2 add_boolean() { return false + true; }
|
|
bool2 sub_boolean() { return false - true; }
|
|
bool2 mul_boolean() { return false * true; }
|
|
bool2 div_boolean() { return false / true; }
|
|
bool2 mod_boolean() { return false % true; }
|
|
bool2 shl_boolean() { return false << true; }
|
|
bool2 shr_boolean() { return false >> true; }
|
|
bool2 neg_boolean() { return -false; }
|
|
bool2 bitnot_boolean() { return ~false; }
|
|
bool2 bitand_boolean() { return false & true; }
|
|
bool2 bitor_boolean() { return false | true; }
|
|
bool2 bitxor_boolean() { return false ^ true; }
|
|
|
|
bool2 add_boolean_vec() { return bool2(false, false) + bool2(true, true); }
|
|
bool2 sub_boolean_vec() { return bool2(false, false) - bool2(true, true); }
|
|
bool2 mul_boolean_vec() { return bool2(false, false) * bool2(true, true); }
|
|
bool2 div_boolean_vec() { return bool2(false, false) / bool2(true, true); }
|
|
bool2 mod_boolean_vec() { return bool2(false, false) % bool2(true, true); }
|
|
bool2 shl_boolean_vec() { return bool2(false, false) << bool2(true, true); }
|
|
bool2 shr_boolean_vec() { return bool2(false, false) >> bool2(true, true); }
|
|
bool2 not_boolean_vec() { return !bool2(false, false); }
|
|
bool2 neg_boolean_vec() { return -bool2(false, false); }
|
|
bool2 bitnot_boolean_vec() { return ~bool2(false, false); }
|
|
bool2 bitand_boolean_vec() { return bool2(false, false) & bool2(true, true); }
|
|
bool2 bitor_boolean_vec() { return bool2(false, false) | bool2(true, true); }
|
|
bool2 bitxor_boolean_vec() { return bool2(false, false) ^ bool2(true, true); }
|
|
|
|
void main() {
|
|
add_boolean();
|
|
sub_boolean();
|
|
mul_boolean();
|
|
div_boolean();
|
|
mod_boolean();
|
|
shl_boolean();
|
|
shr_boolean();
|
|
neg_boolean();
|
|
bitnot_boolean();
|
|
bitand_boolean();
|
|
bitor_boolean();
|
|
bitxor_boolean();
|
|
|
|
add_boolean_vec();
|
|
sub_boolean_vec();
|
|
mul_boolean_vec();
|
|
div_boolean_vec();
|
|
mod_boolean_vec();
|
|
shl_boolean_vec();
|
|
shr_boolean_vec();
|
|
not_boolean_vec();
|
|
neg_boolean_vec();
|
|
bitnot_boolean_vec();
|
|
bitand_boolean_vec();
|
|
bitor_boolean_vec();
|
|
bitxor_boolean_vec();
|
|
}
|