<commit_before>//===- lld/unittest/DriverTest.h ------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <stdarg.h>

#include "gtest/gtest.h"

#include "lld/Driver/Driver.h"
#include "lld/Driver/LinkerInput.h"

#include "llvm/Support/raw_ostream.h"

namespace {

using namespace llvm;
using namespace lld;

template<typename D, typename T>
class ParserTest : public testing::Test {
protected:

  virtual const LinkingContext *linkingContext() = 0;

  std::string &errorMessage() { return  _errorMessage; }

  // Convenience method for getting number of input files.
  int inputFileCount() { return linkingContext()->inputGraph().numFiles(); }

  // Convenience method for getting i'th input files name.
  std::string inputFile(unsigned index) {
    const InputElement &inputElement = linkingContext()->inputGraph()[index];
    if (inputElement.kind() == InputElement::Kind::File)
      return (llvm::dyn_cast<FileNode>(&inputElement))->path(*linkingContext());
    assert(0 && "not handling other types of input files");
  }

  // For unit tests to call driver with various command lines.
  bool parse(const char *args, ...) {
    // Construct command line options from varargs.
    std::vector<const char *> vec;
    vec.push_back(args);
    va_list ap;<commit_msg>[lld][test] fix -Wreturn-type error<commit_after>//===- lld/unittest/DriverTest.h ------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <stdarg.h>

#include "gtest/gtest.h"

#include "lld/Driver/Driver.h"
#include "lld/Driver/LinkerInput.h"

#include "llvm/Support/raw_ostream.h"

namespace {

using namespace llvm;
using namespace lld;

template<typename D, typename T>
class ParserTest : public testing::Test {
protected:

  virtual const LinkingContext *linkingContext() = 0;

  std::string &errorMessage() { return  _errorMessage; }

  // Convenience method for getting number of input files.
  int inputFileCount() { return linkingContext()->inputGraph().numFiles(); }

  // Convenience method for getting i'th input files name.
  std::string inputFile(unsigned index) {
    const InputElement &inputElement = linkingContext()->inputGraph()[index];
    if (inputElement.kind() == InputElement::Kind::File)
      return (llvm::dyn_cast<FileNode>(&inputElement))->path(*linkingContext());
    assert(0 && "not handling other types of input files");
    return "";
  }

  // For unit tests to call driver with various command lines.
  bool parse(const char *args, ...) {
    // Construct command line options from varargs.
    std::vector<const char *> vec;
    vec.push_back(args);
    va_list ap;
{'fraction_non_alphanumeric': 0.19896473633128436, 'fraction_numerical': 0.0012940795858945326, 'mean_word_length': 2.7433414043583535, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3727621', 'n_tokens_mistral': 865, 'n_tokens_neox': 836, 'n_words': 249}