2021-03-15 10:43:11 +00:00
|
|
|
// Copyright 2021 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.
|
|
|
|
|
2022-02-21 15:19:07 +00:00
|
|
|
#include "src/tint/ast/struct_member_align_attribute.h"
|
2021-03-15 10:43:11 +00:00
|
|
|
|
2022-02-21 15:19:07 +00:00
|
|
|
#include "src/tint/ast/test_helper.h"
|
2021-03-15 10:43:11 +00:00
|
|
|
|
2022-04-07 18:39:35 +00:00
|
|
|
namespace tint::ast {
|
2021-03-15 10:43:11 +00:00
|
|
|
namespace {
|
|
|
|
|
2022-02-02 23:07:11 +00:00
|
|
|
using StructMemberAlignAttributeTest = TestHelper;
|
2021-03-15 10:43:11 +00:00
|
|
|
|
2022-02-02 23:07:11 +00:00
|
|
|
TEST_F(StructMemberAlignAttributeTest, Creation) {
|
2022-08-23 13:28:44 +00:00
|
|
|
auto* val = Expr("ident");
|
|
|
|
auto* d = create<StructMemberAlignAttribute>(val);
|
|
|
|
EXPECT_EQ(val, d->align);
|
|
|
|
EXPECT_TRUE(d->align->Is<IdentifierExpression>());
|
2021-03-15 10:43:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
2022-04-07 18:39:35 +00:00
|
|
|
} // namespace tint::ast
|