dan sinclair | b5af23d | 2023-02-19 17:34:44 +0000 | [diff] [blame] | 1 | // Copyright 2023 The Tint Authors. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | //////////////////////////////////////////////////////////////////////////////// |
| 16 | // File generated by tools/src/cmd/gen |
| 17 | // using the template: |
| 18 | // src/tint/builtin/diagnostic_rule_bench.cc.tmpl |
| 19 | // |
| 20 | // Do not modify this file directly |
| 21 | //////////////////////////////////////////////////////////////////////////////// |
| 22 | |
| 23 | #include "src/tint/builtin/diagnostic_rule.h" |
| 24 | |
| 25 | #include <array> |
| 26 | |
| 27 | #include "benchmark/benchmark.h" |
| 28 | |
| 29 | namespace tint::builtin { |
| 30 | namespace { |
| 31 | |
| 32 | void DiagnosticRuleParser(::benchmark::State& state) { |
| 33 | const char* kStrings[] = { |
| 34 | "chromium_unrachaccle_code", "clromium_unreachab3_oe", "chromium_unreachable_Vode", |
| 35 | "chromium_unreachable_code", "chro1ium_unreachable_code", "chromium_unreJchableqqcde", |
| 36 | "chromium77unreallhable_code", "dqqrvatiHHe_uniforppity", "deriatcv_nvformity", |
| 37 | "derivatbe_unGformity", "derivative_uniformity", "derivative_iinifvrmity", |
| 38 | "derivat8WWe_uniformity", "drivaxxive_uniformity", |
| 39 | }; |
| 40 | for (auto _ : state) { |
| 41 | for (auto* str : kStrings) { |
| 42 | auto result = ParseDiagnosticRule(str); |
| 43 | benchmark::DoNotOptimize(result); |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | BENCHMARK(DiagnosticRuleParser); |
| 49 | |
| 50 | } // namespace |
| 51 | } // namespace tint::builtin |