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 8// Author: kenton@google.com (Kenton Varda) 9// Based on original Protocol Buffers design by 10// Sanjay Ghemawat, Jeff Dean, and others. 11// 12// A proto file which uses optimize_for = CODE_SIZE. 13 14syntax = "proto2"; 15 16package protobuf_unittest; 17 18import "google/protobuf/unittest.proto"; 19 20option optimize_for = CODE_SIZE; 21 22message TestOptimizedForSize { 23 optional int32 i = 1; 24 optional ForeignMessage msg = 19; 25 26 extensions 1000 to max; 27 28 extend TestOptimizedForSize { 29 optional int32 test_extension = 1234; 30 optional TestRequiredOptimizedForSize test_extension2 = 1235; 31 } 32 33 oneof foo { 34 int32 integer_field = 2; 35 string string_field = 3; 36 } 37} 38 39message TestRequiredOptimizedForSize { 40 required int32 x = 1; 41} 42 43message TestOptionalOptimizedForSize { 44 optional TestRequiredOptimizedForSize o = 1; 45} 46