mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-24 12:42:11 +00:00
This CL updates the IR to only show types on the LHS of an assignment. The RHS does not show the types anymore. This removes a lot of clutter from the output. Bug: tint:1718 Change-Id: I5e9cff2ae5cd727a7a8cb256d08b417233a197d3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133240 Reviewed-by: Ben Clayton <bclayton@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com> Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
// Copyright 2023 The Tint Authors.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#include "src/tint/ir/test_helper.h"
|
|
|
|
#include "gmock/gmock.h"
|
|
#include "src/tint/ast/case_selector.h"
|
|
#include "src/tint/ast/int_literal_expression.h"
|
|
#include "src/tint/constant/scalar.h"
|
|
|
|
namespace tint::ir {
|
|
namespace {
|
|
|
|
using namespace tint::number_suffixes; // NOLINT
|
|
|
|
using IR_BuilderImplTest = TestHelper;
|
|
|
|
TEST_F(IR_BuilderImplTest, EmitStatement_Assign) {
|
|
GlobalVar("a", ty.u32(), builtin::AddressSpace::kPrivate);
|
|
|
|
auto* expr = Assign("a", 4_u);
|
|
WrapInFunction(expr);
|
|
|
|
auto m = Build();
|
|
ASSERT_TRUE(m) << (!m ? m.Failure() : "");
|
|
|
|
EXPECT_EQ(Disassemble(m.Get()), R"(%fn1 = block {
|
|
%a:ptr<private, u32, read_write> = var
|
|
}
|
|
|
|
|
|
%fn2 = func test_function():void [@compute @workgroup_size(1, 1, 1)] {
|
|
%fn3 = block {
|
|
store %a, 4u
|
|
} -> %func_end # return
|
|
} %func_end
|
|
|
|
)");
|
|
}
|
|
|
|
} // namespace
|
|
} // namespace tint::ir
|