blob: 98b9bbf2a0bf85761e1fb25ecc1a1040b0c028fe [file] [log] [blame]
Vitaly Buka410a6b22018-06-07 19:17:46 +00001//===-- cxx_loop_proto.proto - Protobuf description of C++ with for loops -===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// This file describes a subset of C++ as a protobuf. It is used to
12/// more easily find interesting inputs for fuzzing Clang. This subset
Matt Morehouse1dc1ff82018-06-08 00:33:35 +000013/// differs from the one defined in cxx_proto.proto by eliminating while
14/// loops and Lvalues. The goal is that the C++ code generated will be
15/// more likely to stress the LLVM loop vectorizer.
Vitaly Buka410a6b22018-06-07 19:17:46 +000016///
17//===----------------------------------------------------------------------===//
18
Vitaly Buka410a6b22018-06-07 19:17:46 +000019syntax = "proto2";
20
Vitaly Buka410a6b22018-06-07 19:17:46 +000021message Const {
22 required int32 val = 1;
23}
24
25message BinaryOp {
26 enum Op {
27 PLUS = 0;
28 MINUS = 1;
29 MUL = 2;
30 DIV = 3;
31 MOD = 4;
32 XOR = 5;
33 AND = 6;
34 OR = 7;
35 EQ = 8;
36 NE = 9;
37 LE = 10;
38 GE = 11;
39 LT = 12;
40 GT = 13;
41 };
42 required Op op = 1;
43 required Rvalue left = 2;
44 required Rvalue right = 3;
45}
46
47message Rvalue {
48 oneof rvalue_oneof {
Matt Morehouse1dc1ff82018-06-08 00:33:35 +000049 Const cons = 1;
50 BinaryOp binop = 2;
Vitaly Buka410a6b22018-06-07 19:17:46 +000051 }
52}
53
54message AssignmentStatement {
Vitaly Buka410a6b22018-06-07 19:17:46 +000055 required Rvalue rvalue = 2;
56}
57
Vitaly Buka410a6b22018-06-07 19:17:46 +000058message IfElse {
59 required Rvalue cond = 1;
60 required StatementSeq if_body = 2;
61 required StatementSeq else_body = 3;
62}
63
Vitaly Buka410a6b22018-06-07 19:17:46 +000064message Statement {
65 oneof stmt_oneof {
66 AssignmentStatement assignment = 1;
67 IfElse ifelse = 2;
Vitaly Buka410a6b22018-06-07 19:17:46 +000068 }
69}
70
71message StatementSeq {
72 repeated Statement statements = 1;
73}
74
75message LoopFunction {
76 required StatementSeq statements = 1;
77}
78
79package clang_fuzzer;