Restore "MSL writer: make signed int overflow defined behaviour"

This reverts commit e33b0baa08.

Added tests/expressions/literals/intmin.wgsl test.

Bug: tint:124
Change-Id: I3d46f939ff20fa377ddb5fcb52f9afe728b8e430
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60441
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Antonio Maiorano
2021-07-30 18:59:06 +00:00
committed by Tint LUCI CQ
parent 9bdf2dcc6b
commit d388bc9b36
686 changed files with 4111 additions and 3079 deletions

View File

@@ -2,7 +2,7 @@
using namespace metal;
void foo(thread float2* const tint_symbol_1, thread int3* const tint_symbol_2, thread uint4* const tint_symbol_3, thread bool2* const tint_symbol_4) {
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
(*(tint_symbol_1))[i] = 1.0f;
(*(tint_symbol_2))[i] = 1;
(*(tint_symbol_3))[i] = 1u;
@@ -15,7 +15,7 @@ kernel void tint_symbol() {
thread int3 tint_symbol_6 = 0;
thread uint4 tint_symbol_7 = 0u;
thread bool2 tint_symbol_8 = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
foo(&(tint_symbol_5), &(tint_symbol_6), &(tint_symbol_7), &(tint_symbol_8));
}
return;

View File

@@ -14,7 +14,7 @@ kernel void tint_symbol() {
thread int3 tint_symbol_6 = 0;
thread uint4 tint_symbol_7 = 0u;
thread bool2 tint_symbol_8 = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
foo(&(tint_symbol_5), &(tint_symbol_6), &(tint_symbol_7), &(tint_symbol_8));
}
return;

View File

@@ -14,7 +14,7 @@ kernel void tint_symbol() {
bool2 v2b = false;
bool3 v3b = false;
bool4 v4b = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v3f[i] = 1.0f;
v4f[i] = 1.0f;

View File

@@ -10,7 +10,7 @@ kernel void tint_symbol() {
uint4 v4u_2 = 0u;
bool2 v2b = false;
bool2 v2b_2 = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v3i[i] = 1;
v4u[i] = 1u;

View File

@@ -14,7 +14,7 @@ kernel void tint_symbol() {
bool2 v2b = false;
bool3 v3b = false;
bool4 v4b = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v2i[i] = 1;
v2u[i] = 1u;