unittest_optimize_for.proto 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. //
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file or at
  6. // https://developers.google.com/open-source/licenses/bsd
  7. // Author: kenton@google.com (Kenton Varda)
  8. // Based on original Protocol Buffers design by
  9. // Sanjay Ghemawat, Jeff Dean, and others.
  10. //
  11. // A proto file which uses optimize_for = CODE_SIZE.
  12. syntax = "proto2";
  13. package protobuf_unittest;
  14. import "google/protobuf/unittest.proto";
  15. option optimize_for = CODE_SIZE;
  16. message TestOptimizedForSize {
  17. optional int32 i = 1;
  18. optional ForeignMessage msg = 19;
  19. extensions 1000 to max;
  20. extend TestOptimizedForSize {
  21. optional int32 test_extension = 1234;
  22. optional TestRequiredOptimizedForSize test_extension2 = 1235;
  23. }
  24. oneof foo {
  25. int32 integer_field = 2;
  26. string string_field = 3;
  27. }
  28. }
  29. message TestRequiredOptimizedForSize {
  30. required int32 x = 1;
  31. }
  32. message TestOptionalOptimizedForSize {
  33. optional TestRequiredOptimizedForSize o = 1;
  34. }