From 428409d928593436f7671a014f5c021d994a71fc Mon Sep 17 00:00:00 2001 From: Eric Salo Date: Wed, 1 Jul 2026 18:28:53 -0700 Subject: [PATCH] protobuf: add support for Go prototiller in codegen tests PiperOrigin-RevId: 941394877 --- .../golden/compare_cpp_codegen_failure.txt | 73 +++++++++++++++++-- .../golden/compare_cpp_codegen_failure.xml | 18 ++++- .../golden/compare_cpp_codegen_multiple.txt | 40 +++++++--- .../golden/compare_cpp_codegen_multiple.xml | 30 ++++++-- .../golden/compare_cpp_codegen_success.txt | 20 +++-- .../golden/compare_cpp_codegen_success.xml | 16 +++- 6 files changed, 158 insertions(+), 39 deletions(-) diff --git a/editions/golden/compare_cpp_codegen_failure.txt b/editions/golden/compare_cpp_codegen_failure.txt index 5a1746dc5d688..3b73849728c30 100644 --- a/editions/golden/compare_cpp_codegen_failure.txt +++ b/editions/golden/compare_cpp_codegen_failure.txt @@ -1,4 +1,4 @@ -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go) @@ @@ ::_pbi::TcParser::GetTable<::protobuf_editions_test::golden::SimpleProto3>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE @@ -34,8 +34,65 @@ cached_has_bits = this_._impl_._has_bits_[0]; if (CheckHasBit(cached_has_bits, 0x00000001U)) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( -[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h +[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java) +@@ @@ + ::_pbi::TcParser::GetTable<::protobuf_editions_test::golden::SimpleProto3>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1; + {::_pbi::TcParser::FastV32S1, + {8, 0, 0, + PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_)}}, + }}, {{ + 65535, 65535 + }}, {{ +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1; + {PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + }}, + // no aux_entries +@@ @@ + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + target = + ::proto2::internal::WireFormatLite::WriteInt32ToArrayWithField<1>( +@@ @@ + ::uint32_t cached_has_bits [[maybe_unused]] = 0; + + { +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( +[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go) +@@ @@ + enum : int { + kInt32FieldFieldNumber = 1, + }; +- // optional int32 int32_field = 1; ++ // int32 int32_field = 1; + [[nodiscard]] bool has_int32_field() const; + void clear_int32_field() ; + [[nodiscard]] ::int32_t int32_field() const; +@@ @@ + + // SimpleProto3 + +-// optional int32 int32_field = 1; ++// int32 int32_field = 1; + inline bool SimpleProto3::has_int32_field() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U); + return value; +[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java) @@ @@ enum : int { kInt32FieldFieldNumber = 1, @@ -54,6 +111,10 @@ inline bool SimpleProto3::has_int32_field() const { bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U); return value; -[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.h -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h -[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h +[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence) diff --git a/editions/golden/compare_cpp_codegen_failure.xml b/editions/golden/compare_cpp_codegen_failure.xml index 80f91bed7b99e..c1fae83b27683 100644 --- a/editions/golden/compare_cpp_codegen_failure.xml +++ b/editions/golden/compare_cpp_codegen_failure.xml @@ -1,13 +1,23 @@ - + - + - + + + + + + + - + + + + + diff --git a/editions/golden/compare_cpp_codegen_multiple.txt b/editions/golden/compare_cpp_codegen_multiple.txt index b21fd68b70a98..372bb19ba2dac 100644 --- a/editions/golden/compare_cpp_codegen_multiple.txt +++ b/editions/golden/compare_cpp_codegen_multiple.txt @@ -1,12 +1,28 @@ -[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.cc -[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.cc -[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.h -[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.h -[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h -[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc -[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h -[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h -[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto (Go vs Java Equivalence) +[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto (Go vs Java Equivalence) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence) diff --git a/editions/golden/compare_cpp_codegen_multiple.xml b/editions/golden/compare_cpp_codegen_multiple.xml index c93b7f1e87cb1..420e7520184d5 100644 --- a/editions/golden/compare_cpp_codegen_multiple.xml +++ b/editions/golden/compare_cpp_codegen_multiple.xml @@ -1,17 +1,33 @@ - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + diff --git a/editions/golden/compare_cpp_codegen_success.txt b/editions/golden/compare_cpp_codegen_success.txt index 0c5c6d459f5bd..9503c4c53c35b 100644 --- a/editions/golden/compare_cpp_codegen_success.txt +++ b/editions/golden/compare_cpp_codegen_success.txt @@ -1,6 +1,14 @@ -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc -[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h -[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h -[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h -[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java) +[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence) +[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence) diff --git a/editions/golden/compare_cpp_codegen_success.xml b/editions/golden/compare_cpp_codegen_success.xml index 65fc89aa2ccd8..6f5653b27145a 100644 --- a/editions/golden/compare_cpp_codegen_success.xml +++ b/editions/golden/compare_cpp_codegen_success.xml @@ -1,11 +1,19 @@ - + - + - + - + + + + + + + + +