Skip to content

Instantly share code, notes, and snippets.

View EricWF's full-sized avatar

Eric EricWF

View GitHub Profile
// RUN: %clang_cc1 -triple x86_64-apple-darwin10.0.0 -fresumable-functions -emit-llvm -o - %s -fexceptions -std=c++17 | FileCheck %s
resumable int foo() {
return 42;
}
void bar() {
resumable auto r = foo();
bool b = r.ready();
int x = r.result();
@EricWF
EricWF / DefaultInitIssue.md
Last active July 10, 2018 23:41
Fixes for the specification of default-initialization and value-initialization.

Unify the behavior of value-initialization and default-initialization.

Introduction

Currently default-initialization and value-initialization act bizzarely compared to each other. Specifically default-initialization is required to call trivial constructors when value-initialization is not.

For example:

struct T { int x; };
// default_init is initialized by a call to the trivial default ctor.
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <functional>
  • Can constructors be resumable functions?
  • Can resumable variable declarations be static or thread local?
  • Can resumable variables declarations occur at global scope?
  • Must resumable variable declarations be declared with an auto specifier?
  • Currently, resumable functions must be defined by the end of the TU. I think this may need to be weakened to before they're used.
  • Static functions should also be allowed to be implicitly resumable, like inline functions.
Insbruke austria
"land of castles"
Vorarlberg
- Go in july
#include "benchmark/benchmark.h"
#include "GenerateInput.hpp"
#include "test_iterators.h"
#include <ciso646>
#ifdef _LIBCPP_VERSION
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
project(test-cmake CXX)
cmake_minimum_required(VERSION 3.9)
#
set(header_in ${CMAKE_CURRENT_BINARY_DIR}/header.in)
file(WRITE ${header_in}
"
#ifndef MY_HEADER
#define MY_HEADER
int my_x = 42;

Google Benchmark V2 Design Document

This document lays out the design goals for v2 of the Google Benchmark library, as well as the problems and use-cases they're intented to address.

Supporting Arbitrary User Input and Output

One problem with v1 of the library is its limitations in allowing users to provide arbitrary input to their benchmarks, as well as specifying arbitrary output as part of the results. Multiple

static bool have_entered_main = false;
static int num_constructed = 0;
class StaticInitFixtureTest : public ::benchmark::Fixture {
public:
StaticInitFixtureTest() {
++num_constructed;
assert(have_entered_main);
}
// See llvm.org/PR35078
TEST_CASE(test_PR35078)
{
using namespace std::experimental::filesystem;
scoped_test_env env;
const path testFiles[] = {
env.create_dir("dir1"),
env.create_dir("dir1/dir2"),
env.create_dir("dir1/dir2/dir3"),