2018-06-08 03:17:46 +08:00
|
|
|
//===-- cxx_loop_proto.proto - Protobuf description of C++ with for loops -===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-06-08 03:17:46 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// This file describes a subset of C++ as a protobuf. It is used to
|
2018-08-16 07:05:48 +08:00
|
|
|
/// more easily find interesting inputs for fuzzing LLVM's vectorizer.
|
|
|
|
/// This subset differs from the one defined in cxx_proto.proto by eliminating
|
|
|
|
/// while loops and conditionals. The goal is that the C++ code generated will
|
|
|
|
/// be more likely to stress the LLVM loop vectorizer. The code generated will
|
|
|
|
/// contain either a single loop or two nested loops.
|
2018-06-08 03:17:46 +08:00
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
syntax = "proto2";
|
|
|
|
|
|
|
|
message Const {
|
|
|
|
required int32 val = 1;
|
|
|
|
}
|
|
|
|
|
2018-06-12 01:05:45 +08:00
|
|
|
message VarRef {
|
|
|
|
// Add an enum for each array in function signature
|
|
|
|
enum Arr {
|
|
|
|
ARR_A = 0;
|
|
|
|
ARR_B = 1;
|
|
|
|
ARR_C = 2;
|
|
|
|
};
|
|
|
|
required Arr arr = 1;
|
|
|
|
}
|
|
|
|
|
2018-06-08 03:17:46 +08:00
|
|
|
message BinaryOp {
|
|
|
|
enum Op {
|
|
|
|
PLUS = 0;
|
|
|
|
MINUS = 1;
|
|
|
|
MUL = 2;
|
2018-06-23 02:05:00 +08:00
|
|
|
XOR = 3;
|
|
|
|
AND = 4;
|
|
|
|
OR = 5;
|
|
|
|
EQ = 6;
|
|
|
|
NE = 7;
|
|
|
|
LE = 8;
|
|
|
|
GE = 9;
|
|
|
|
LT = 10;
|
|
|
|
GT = 11;
|
2018-06-08 03:17:46 +08:00
|
|
|
};
|
|
|
|
required Op op = 1;
|
|
|
|
required Rvalue left = 2;
|
|
|
|
required Rvalue right = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Rvalue {
|
|
|
|
oneof rvalue_oneof {
|
2018-06-08 08:33:35 +08:00
|
|
|
Const cons = 1;
|
|
|
|
BinaryOp binop = 2;
|
2018-06-12 01:05:45 +08:00
|
|
|
VarRef varref = 3;
|
2018-06-08 03:17:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message AssignmentStatement {
|
2018-06-12 01:05:45 +08:00
|
|
|
required VarRef varref = 1;
|
2018-06-08 03:17:46 +08:00
|
|
|
required Rvalue rvalue = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Statement {
|
2018-06-12 01:05:45 +08:00
|
|
|
required AssignmentStatement assignment = 1;
|
2018-06-08 03:17:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message StatementSeq {
|
|
|
|
repeated Statement statements = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoopFunction {
|
2018-08-16 07:05:48 +08:00
|
|
|
optional StatementSeq inner_statements = 1;
|
|
|
|
required StatementSeq outer_statements = 2;
|
2018-06-08 03:17:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package clang_fuzzer;
|