blob: cec1a435dcf105efb5f6e6210f736ea6017f72fb [file] [log] [blame]
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>Test prefix/postfix.</title>
<script src="js/whlsl-test-harness.js"></script>
<script src="js/webgpu-functions.js"></script>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
const whlslTests = {};
whlslTests.variableShadowing = async () =>
{
let program = `
int foo()
{
int y;
int x = 7;
{
int x = 8;
y = x;
}
return y;
}
`;
assert_equals(await callIntFunction(program, "foo", []), 8);
program = `
int foo()
{
int y;
int x = 7;
{
int x = 8;
}
y = x;
return y;
}
`;
assert_equals(await callIntFunction(program, "foo", []), 7);
}
runTests(whlslTests);
</script>
</html>