text:
```c
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Vitaly Kuznetsov <vkuznets@redhat.com>
X-Patchwork-Id: 11423843
Return-Path: <SRS0=b048=4X=vger.kernel.org=kvm-owner@kernel.org>
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
 [172.30.200.123])
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5CCB3921
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 13:02:27 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id 3DCCB2166E
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 13:02:27 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com
 header.b="Q6oy0vfp"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1727146AbgCFNC0 (ORCPT
        <rfc822;patchwork-kvm@patchwork.kernel.org>);
        Fri, 6 Mar 2020 08:02:26 -0500
Received: from us-smtp-1.mimecast.com ([207.211.31.81]:34939 "EHLO
        us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL)
        by vger.kernel.org with ESMTP id S1726733AbgCFNCZ (ORCPT
        <rfc822;kvm@vger.kernel.org>); Fri, 6 Mar 2020 08:02:25 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
        s=mimecast20190719; t=1583499744;
        h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
         to:to:cc:cc:mime-version:mime-version:
         content-transfer-encoding:content-transfer-encoding:
         in-reply-to:in-reply-to:references:references;
        bh=y2yWNaYqjJ/RvKkVVduCbhM3C1I4Zkz6logIvpDXjRI=;
        b=Q6oy0vfpoUSWpizjCenTyIP2H4xFppaP/aL07Tm8nzTBA6pdF1XE+jmnddi2ZcTyWuBlAa
        w3wCs136ssTu+Svp7AkJQeLFFeBLaCNSFlm9uStyelesBKIk/WmWKtDkm8F4UYOkp2ctCO
        /ce8cmJ3WZQZZHlewRo8GFYP/uo7N9s=
Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com
 [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-39-wG0-d9-HNH2lQX5CDpht-g-1; Fri, 06 Mar 2020 08:02:20 -0500
X-MC-Unique: wG0-d9-HNH2lQX5CDpht-g-1
Received: by mail-wm1-f69.google.com with SMTP id y7so859576wmd.4
        for <kvm@vger.kernel.org>; Fri, 06 Mar 2020 05:02:20 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
         :references:mime-version:content-transfer-encoding;
        bh=y2yWNaYqjJ/RvKkVVduCbhM3C1I4Zkz6logIvpDXjRI=;
        b=gjBXfGAR4kLou//3lyaAI8T0E4rmodS85S0CpWR+wcKxcweqQXZmTjks6+1CPtjAsW
         T6tBFLIqqoWKLLdKeysTV3f8UHdPQzq+m+8r/UraopYsyUm0b/zWnbTnMVzA6iZrFFzO
         gMLaqvrj7KM3VcN8RqbmR1Pf7RjHCmV1O+b2GkxdFdFpw7XsOu6j1UmJDgjmCAfCYy6Q
         sYjBdbsk/76qY9MgJ4Lu65lJmFU8PLWhKvFuE3iFwxBY/WqOzI8qV6i0T/g366jofJml
         RuO5y9kYZIs4leEEVb8hT3mTCZTG6cBL9vMwu05hnKXQx95mz3lcCcb6QdtjVxu4yUPe
         lgfA==
X-Gm-Message-State: ANhLgQ3wwSqwi3cmsT1IqZC87bPc8lxZVrO8cLE21rjUBwdSnALTD358
        rSzBxD33rO+47z/Y2Hvybs/G/pWLC2fPgD3899N89tNPi+AuVE3BjdiSGcvAG5BeNuZfIFuAohU
        2BvXrbgZ4Qy4u
X-Received: by 2002:a5d:6690:: with SMTP id l16mr4193877wru.251.1583499739787;
        Fri, 06 Mar 2020 05:02:19 -0800 (PST)
X-Google-Smtp-Source:
 ADFU+vt1OXPzlEbyvBAvceW/RbmClBEpZeiagwVFOODbocvqNKeEiZjWeqYhWm0qnk58uiEN6mYnZw==
X-Received: by 2002:a5d:6690:: with SMTP id l16mr4193848wru.251.1583499739540;
        Fri, 06 Mar 2020 05:02:19 -0800 (PST)
Received: from vitty.brq.redhat.com (nat-pool-brq-t.redhat.com.
 [213.175.37.10])
        by smtp.gmail.com with ESMTPSA id
 i67sm26613243wri.50.2020.03.06.05.02.18
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 06 Mar 2020 05:02:18 -0800 (PST)
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jim Mattson <jmattson@google.com>,
        Sean Christopherson <sean.j.christopherson@intel.com>,
        Wanpeng Li <wanpengli@tencent.com>, kvm@vger.kernel.org,
        linux-kernel@vger.kernel.org
Subject: [PATCH v3 1/2] KVM: VMX: rename 'kvm_area' to 'vmxon_region'
Date: Fri,  6 Mar 2020 14:02:14 +0100
Message-Id: <20200306130215.150686-2-vkuznets@redhat.com>
X-Mailer: git-send-email 2.24.1
In-Reply-To: <20200306130215.150686-1-vkuznets@redhat.com>
References: <20200306130215.150686-1-vkuznets@redhat.com>
MIME-Version: 1.0
Sender: kvm-owner@vger.kernel.org
Precedence: bulk
List-ID: <kvm.vger.kernel.org>
X-Mailing-List: kvm@vger.kernel.org

The name 'kvm_area' is misleading (as we have way too many areas which are
KVM related), what alloc_kvm_area()/free_kvm_area() functions really do is
allocate/free VMXON region for all CPUs. Rename accordingly.

No functional change intended.

Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
---
 arch/x86/kvm/vmx/vmx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

```
#### [PATCH v1 1/3] i386: Add "pebs" parameter to enable PEBS feature
##### From: Luwei Kang <luwei.kang@intel.com>

```c
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: "Kang, Luwei" <luwei.kang@intel.com>
X-Patchwork-Id: 11422941
Return-Path: <SRS0=b048=4X=vger.kernel.org=kvm-owner@kernel.org>
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
 [172.30.200.123])
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3812717E0
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 02:21:43 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id 232F620801
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 02:21:43 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1726682AbgCFCVm (ORCPT
        <rfc822;patchwork-kvm@patchwork.kernel.org>);
        Thu, 5 Mar 2020 21:21:42 -0500
Received: from mga18.intel.com ([134.134.136.126]:19708 "EHLO mga18.intel.com"
        rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
        id S1726533AbgCFCVm (ORCPT <rfc822;kvm@vger.kernel.org>);
        Thu, 5 Mar 2020 21:21:42 -0500
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga005.jf.intel.com ([10.7.209.41])
  by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 05 Mar 2020 18:21:41 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.70,520,1574150400";
   d="scan'208";a="413742185"
Received: from snr.bj.intel.com ([10.240.193.90])
  by orsmga005.jf.intel.com with ESMTP; 05 Mar 2020 18:21:39 -0800
From: Luwei Kang <luwei.kang@intel.com>
To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com,
        mst@redhat.com, marcel.apfelbaum@gmail.com
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
        Luwei Kang <luwei.kang@intel.com>
Subject: [PATCH v1 1/3] i386: Add "pebs" parameter to enable PEBS feature
Date: Fri,  6 Mar 2020 18:20:03 +0800
Message-Id: <1583490005-27761-2-git-send-email-luwei.kang@intel.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1583490005-27761-1-git-send-email-luwei.kang@intel.com>
References: <1583490005-27761-1-git-send-email-luwei.kang@intel.com>
Sender: kvm-owner@vger.kernel.org
Precedence: bulk
List-ID: <kvm.vger.kernel.org>
X-Mailing-List: kvm@vger.kernel.org

The PEBS virtualization enabling in KVM guest will be supported start from
IceLake hardware. This patch introduce a new CPU parameter "pebs" to enable
PEBS feature. The paramter of "pebs" is false by default.

PDCM,DTES64,DTS are needed by PEBS feature. Expose these feature bits to
KVM guest when the KVM support PEBS virtualization and the "pebs" parameter
is true.

Signed-off-by: Luwei Kang <luwei.kang@intel.com>
---
 hw/i386/pc.c      |  1 +
 target/i386/cpu.c | 14 ++++++++++++++
 target/i386/cpu.h |  7 +++++++
 3 files changed, 22 insertions(+)

```
#### [PATCH 07/22] mips: Add MIPS32 Release 5 support
##### From: <Sergey.Semin@baikalelectronics.ru>

```c
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Sergey Semin <Sergey.Semin@baikalelectronics.ru>
X-Patchwork-Id: 11423737
Return-Path: <SRS0=b048=4X=vger.kernel.org=kvm-owner@kernel.org>
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
 [172.30.200.123])
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0219A1395
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 12:18:16 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id B20A4208C3
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 12:18:15 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1726905AbgCFMSL (ORCPT
        <rfc822;patchwork-kvm@patchwork.kernel.org>);
        Fri, 6 Mar 2020 07:18:11 -0500
Received: from mail.baikalelectronics.com ([87.245.175.226]:35038 "EHLO
        mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1726973AbgCFMSJ (ORCPT <rfc822;kvm@vger.kernel.org>);
        Fri, 6 Mar 2020 07:18:09 -0500
X-Greylist: delayed 405 seconds by postgrey-1.27 at vger.kernel.org;
 Fri, 06 Mar 2020 07:18:04 EST
Received: from localhost (unknown [127.0.0.1])
        by mail.baikalelectronics.ru (Postfix) with ESMTP id 8B4398030795;
        Fri,  6 Mar 2020 12:11:18 +0000 (UTC)
X-Virus-Scanned: amavisd-new at baikalelectronics.ru
Received: from mail.baikalelectronics.ru ([127.0.0.1])
        by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new,
 port 10024)
        with ESMTP id CyGbeyZB4V-0; Fri,  6 Mar 2020 15:11:17 +0300 (MSK)
From: <Sergey.Semin@baikalelectronics.ru>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
CC: Serge Semin <Sergey.Semin@baikalelectronics.ru>,
        Serge Semin <fancer.lancer@gmail.com>,
        Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
        Paul Burton <paulburton@kernel.org>,
        Ralf Baechle <ralf@linux-mips.org>,
        <linux-mips@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
        <kvm@vger.kernel.org>
Subject: [PATCH 07/22] mips: Add MIPS32 Release 5 support
Date: Fri, 6 Mar 2020 15:08:31 +0300
In-Reply-To: <20200306120847.32690-1-Sergey.Semin@baikalelectronics.ru>
References: <20200306120847.32690-1-Sergey.Semin@baikalelectronics.ru>
MIME-Version: 1.0
X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25)
Message-Id: <20200306121118.8B4398030795@mail.baikalelectronics.ru>
Sender: kvm-owner@vger.kernel.org
Precedence: bulk
List-ID: <kvm.vger.kernel.org>
X-Mailing-List: kvm@vger.kernel.org

From: Serge Semin <Sergey.Semin@baikalelectronics.ru>

There are five MIPS32/64 architecture releases currently available:
from 1 to 6 except fourth one, which was intentionally skipped.
Three of them can be called as major: 1st, 2nd and 6th, that not only
have some system level alterations, but also introduced significant
core/ISA level updates. The rest of the MIPS architecture releases are
minor.

Even though they don't have as much ISA/system/core level changes
as the major ones with respect to the previous releases, they still
provide a set of updates (I'd say they were intended to be the
intermediate releases before a major one) that might be useful for the
kernel and user-level code, when activated by the kernel or compiler.
In particular the following features were introduced or ended up being
available at/after MIPS32 Release 5 architecture:
+ the last release of the misaligned memory access instructions,
+ virtualisation - VZ ASE - is optional component of the arch,
+ SIMD - MSA ASE - is optional component of the arch,
+ DSP ASE is optional component of the arch,
+ CP0.Status.FR=1 for CP1.FIR.F64=1 (pure 64-bit FPU general registers)
  must be available if FPU is implemented,
+ CP1.FIR.Has2008 support is required so CP1.FCSR.{ABS2008,NAN2008} bits
  are available.
+ UFR/UNFR aliases to access CP0.Status.FR from user-space by means of
  ctc1/cfc1 instructions (enabled by CP0.Config5.UFR),
+ CP0.COnfig5.LLB=1 and eretnc instruction are implemented to without
  accidentally clearing LL-bit when returning from an interrupt,
  exception, or error trap,
+ XPA feature together with extended versions of CPx registers is
  introduced, which needs to have mfhc0/mthc0 instructions available.

So due to these changes GNU GCC provides an extended instructions set
support for MIPS32 Release 5 by default like eretnc/mfhc0/mthc0. Even
though the architecture alteration isn't that big, it still worth to be
taken into account by the kernel software. Finally we can't deny that
some optimization/limitations might be found in future and implemented
on some level in kernel or compiler. In this case having even
intermediate MIPS architecture releases support would be more than
useful.

So the most of the changes provided by this commit can be split into
either compile- or runtime configs related. The compile-time related
changes are caused by adding the new CONFIG_CPU_MIPS32_R5/CONFIG_CPU_MIPSR5
configs and concern the code activating MIPSR2 or MIPSR6 already
implemented features (like eretnc/LLbit, mthc0/mfhc0). In addition
CPU_HAS_MSA can be now freely enabled for MIPS32 release 5 based
platforms as this is done for CPU_MIPS32_R6 CPUs. The runtime changes
concerns the features which are handled with respect to the MIPS ISA
revision detected at run-time by means of CP0.Config.{AT,AR} bits. Alas
these fields can be used to detect either r1 or r2 or r6 releases.
But since we know which CPUs in fact support the R5 arch, we can manually
set MIPS_CPU_ISA_M32R5 bit of c->isa_level and then use cpu_has_mips32_r5
where it's appropriate.

Since XPA/EVA provide too complex alterationss and to have them used with
MIPS32 Release 2 charged kernels (for compatibility with current platform
configs) they are left to be setup as a separate kernel configs.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
Even without this patch the code contains too many patterns like:
+#if defined(CONFIG_MIPS32R2) || defined(CONFIG_MIPS32R6)
What about switching it to a simpler
+#if CONFIG_TARGET_ISA_REV >= 2 ?
Though I'd prefer this config to be named like CONFIG_CPU_MIPS_REV.
What do you think?

Similarly the pattern like:
(MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 |
 MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 |
 MIPS_CPU_ISA_M32R5 |
 MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)
could be replaced with simpler one:
(MIPS_CPU_ISA_M32 | MIPS_CPU_ISA_M64)
if corresponding macro were available. What do think about adding such?

We also could add CPU_MIPS64_R5 config support here, but I don't think
it's necessary at the moment seeing there is no any real chip ever
produced with that arch. Right?
---
 arch/mips/Kconfig                    | 34 ++++++++++++++++++++++++----
 arch/mips/Makefile                   |  1 +
 arch/mips/include/asm/asmmacro.h     | 18 ++++++++-------
 arch/mips/include/asm/compiler.h     |  5 ++++
 arch/mips/include/asm/cpu-features.h | 20 +++++++++++-----
 arch/mips/include/asm/cpu-info.h     |  2 +-
 arch/mips/include/asm/cpu-type.h     |  6 ++++-
 arch/mips/include/asm/cpu.h          |  7 +++---
 arch/mips/include/asm/fpu.h          |  4 ++--
 arch/mips/include/asm/hazards.h      |  8 ++++---
 arch/mips/include/asm/module.h       |  2 ++
 arch/mips/include/asm/stackframe.h   |  2 +-
 arch/mips/include/asm/switch_to.h    |  8 +++----
 arch/mips/kernel/cpu-probe.c         | 12 ++++++++++
 arch/mips/kernel/entry.S             |  6 ++---
 arch/mips/kernel/proc.c              |  2 ++
 arch/mips/kernel/r4k_fpu.S           | 14 ++++++------
 arch/mips/kvm/vz.c                   |  6 ++---
 arch/mips/lib/csum_partial.S         |  6 +++--
 arch/mips/mm/c-r4k.c                 |  7 +++---
 arch/mips/mm/sc-mips.c               |  7 +++---
 21 files changed, 123 insertions(+), 54 deletions(-)

```
#### [PATCH 07/22] mips: Add MIPS32 Release 5 support
##### From: <Sergey.Semin@baikalelectronics.ru>

```c
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Sergey Semin <Sergey.Semin@baikalelectronics.ru>
X-Patchwork-Id: 11423803
Return-Path: <SRS0=b048=4X=vger.kernel.org=kvm-owner@kernel.org>
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
 [172.30.200.123])
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 313021580
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 12:48:53 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id E472A2187F
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 12:48:52 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1727085AbgCFMst (ORCPT
        <rfc822;patchwork-kvm@patchwork.kernel.org>);
        Fri, 6 Mar 2020 07:48:49 -0500
Received: from mail.baikalelectronics.com ([87.245.175.226]:35516 "EHLO
        mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1726998AbgCFMst (ORCPT <rfc822;kvm@vger.kernel.org>);
        Fri, 6 Mar 2020 07:48:49 -0500
Received: from localhost (unknown [127.0.0.1])
        by mail.baikalelectronics.ru (Postfix) with ESMTP id 472228030794;
        Fri,  6 Mar 2020 12:48:43 +0000 (UTC)
X-Virus-Scanned: amavisd-new at baikalelectronics.ru
Received: from mail.baikalelectronics.ru ([127.0.0.1])
        by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new,
 port 10024)
        with ESMTP id 5kThnAxJGwEA; Fri,  6 Mar 2020 15:48:41 +0300 (MSK)
From: <Sergey.Semin@baikalelectronics.ru>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
CC: Serge Semin <Sergey.Semin@baikalelectronics.ru>,
        Serge Semin <fancer.lancer@gmail.com>,
        Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
        Paul Burton <paulburton@kernel.org>,
        Ralf Baechle <ralf@linux-mips.org>,
        <linux-mips@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
        <kvm@vger.kernel.org>
Subject: [PATCH 07/22] mips: Add MIPS32 Release 5 support
Date: Fri, 6 Mar 2020 15:46:50 +0300
In-Reply-To: <20200306124705.6595-1-Sergey.Semin@baikalelectronics.ru>
References: <20200306124705.6595-1-Sergey.Semin@baikalelectronics.ru>
MIME-Version: 1.0
X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25)
Message-Id: <20200306124843.472228030794@mail.baikalelectronics.ru>
Sender: kvm-owner@vger.kernel.org
Precedence: bulk
List-ID: <kvm.vger.kernel.org>
X-Mailing-List: kvm@vger.kernel.org

From: Serge Semin <Sergey.Semin@baikalelectronics.ru>

There are five MIPS32/64 architecture releases currently available:
from 1 to 6 except fourth one, which was intentionally skipped.
Three of them can be called as major: 1st, 2nd and 6th, that not only
have some system level alterations, but also introduced significant
core/ISA level updates. The rest of the MIPS architecture releases are
minor.

Even though they don't have as much ISA/system/core level changes
as the major ones with respect to the previous releases, they still
provide a set of updates (I'd say they were intended to be the
intermediate releases before a major one) that might be useful for the
kernel and user-level code, when activated by the kernel or compiler.
In particular the following features were introduced or ended up being
available at/after MIPS32 Release 5 architecture:
+ the last release of the misaligned memory access instructions,
+ virtualisation - VZ ASE - is optional component of the arch,
+ SIMD - MSA ASE - is optional component of the arch,
+ DSP ASE is optional component of the arch,
+ CP0.Status.FR=1 for CP1.FIR.F64=1 (pure 64-bit FPU general registers)
  must be available if FPU is implemented,
+ CP1.FIR.Has2008 support is required so CP1.FCSR.{ABS2008,NAN2008} bits
  are available.
+ UFR/UNFR aliases to access CP0.Status.FR from user-space by means of
  ctc1/cfc1 instructions (enabled by CP0.Config5.UFR),
+ CP0.COnfig5.LLB=1 and eretnc instruction are implemented to without
  accidentally clearing LL-bit when returning from an interrupt,
  exception, or error trap,
+ XPA feature together with extended versions of CPx registers is
  introduced, which needs to have mfhc0/mthc0 instructions available.

So due to these changes GNU GCC provides an extended instructions set
support for MIPS32 Release 5 by default like eretnc/mfhc0/mthc0. Even
though the architecture alteration isn't that big, it still worth to be
taken into account by the kernel software. Finally we can't deny that
some optimization/limitations might be found in future and implemented
on some level in kernel or compiler. In this case having even
intermediate MIPS architecture releases support would be more than
useful.

So the most of the changes provided by this commit can be split into
either compile- or runtime configs related. The compile-time related
changes are caused by adding the new CONFIG_CPU_MIPS32_R5/CONFIG_CPU_MIPSR5
configs and concern the code activating MIPSR2 or MIPSR6 already
implemented features (like eretnc/LLbit, mthc0/mfhc0). In addition
CPU_HAS_MSA can be now freely enabled for MIPS32 release 5 based
platforms as this is done for CPU_MIPS32_R6 CPUs. The runtime changes
concerns the features which are handled with respect to the MIPS ISA
revision detected at run-time by means of CP0.Config.{AT,AR} bits. Alas
these fields can be used to detect either r1 or r2 or r6 releases.
But since we know which CPUs in fact support the R5 arch, we can manually
set MIPS_CPU_ISA_M32R5 bit of c->isa_level and then use cpu_has_mips32_r5
where it's appropriate.

Since XPA/EVA provide too complex alterationss and to have them used with
MIPS32 Release 2 charged kernels (for compatibility with current platform
configs) they are left to be setup as a separate kernel configs.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
Even without this patch the code contains too many patterns like:
+#if defined(CONFIG_MIPS32R2) || defined(CONFIG_MIPS32R6)
What about switching it to a simpler
+#if CONFIG_TARGET_ISA_REV >= 2 ?
Though I'd prefer this config to be named like CONFIG_CPU_MIPS_REV.
What do you think?

Similarly the pattern like:
(MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M64R1 |
 MIPS_CPU_ISA_M32R2 | MIPS_CPU_ISA_M64R2 |
 MIPS_CPU_ISA_M32R5 |
 MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6)
could be replaced with simpler one:
(MIPS_CPU_ISA_M32 | MIPS_CPU_ISA_M64)
if corresponding macro were available. What do think about adding such?

We also could add CPU_MIPS64_R5 config support here, but I don't think
it's necessary at the moment seeing there is no any real chip ever
produced with that arch. Right?
---
 arch/mips/Kconfig                    | 34 ++++++++++++++++++++++++----
 arch/mips/Makefile                   |  1 +
 arch/mips/include/asm/asmmacro.h     | 18 ++++++++-------
 arch/mips/include/asm/compiler.h     |  5 ++++
 arch/mips/include/asm/cpu-features.h | 20 +++++++++++-----
 arch/mips/include/asm/cpu-info.h     |  2 +-
 arch/mips/include/asm/cpu-type.h     |  6 ++++-
 arch/mips/include/asm/cpu.h          |  7 +++---
 arch/mips/include/asm/fpu.h          |  4 ++--
 arch/mips/include/asm/hazards.h      |  8 ++++---
 arch/mips/include/asm/module.h       |  2 ++
 arch/mips/include/asm/stackframe.h   |  2 +-
 arch/mips/include/asm/switch_to.h    |  8 +++----
 arch/mips/kernel/cpu-probe.c         | 12 ++++++++++
 arch/mips/kernel/entry.S             |  6 ++---
 arch/mips/kernel/proc.c              |  2 ++
 arch/mips/kernel/r4k_fpu.S           | 14 ++++++------
 arch/mips/kvm/vz.c                   |  6 ++---
 arch/mips/lib/csum_partial.S         |  6 +++--
 arch/mips/mm/c-r4k.c                 |  7 +++---
 arch/mips/mm/sc-mips.c               |  7 +++---
 21 files changed, 123 insertions(+), 54 deletions(-)

```
#### [PATCH 1/7] tools/kvm_stat: rework command line sequence and message texts
##### From: Stefan Raspl <raspl@linux.ibm.com>

```c
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Stefan Raspl <raspl@linux.ibm.com>
X-Patchwork-Id: 11423669
Return-Path: <SRS0=b048=4X=vger.kernel.org=kvm-owner@kernel.org>
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
 [172.30.200.123])
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00C2F14B7
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 11:43:04 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id DE60C2084E
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 11:43:03 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1726879AbgCFLm7 (ORCPT
        <rfc822;patchwork-kvm@patchwork.kernel.org>);
        Fri, 6 Mar 2020 06:42:59 -0500
Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:14564 "EHLO
        mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK)
        by vger.kernel.org with ESMTP id S1726025AbgCFLm7 (ORCPT
        <rfc822;kvm@vger.kernel.org>); Fri, 6 Mar 2020 06:42:59 -0500
Received: from pps.filterd (m0098409.ppops.net [127.0.0.1])
        by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id
 026Bd4b8160103
        for <kvm@vger.kernel.org>; Fri, 6 Mar 2020 06:42:58 -0500
Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100])
        by mx0a-001b2d01.pphosted.com with ESMTP id 2yk33mwx3k-1
        (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT)
        for <kvm@vger.kernel.org>; Fri, 06 Mar 2020 06:42:58 -0500
Received: from localhost
        by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use
 Only! Violators will be prosecuted
        for <kvm@vger.kernel.org> from <raspl@linux.ibm.com>;
        Fri, 6 Mar 2020 11:42:56 -0000
Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197)
        by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway:
 Authorized Use Only! Violators will be prosecuted;
        (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256)
        Fri, 6 Mar 2020 11:42:53 -0000
Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com
 [9.149.105.60])
        by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with
 ESMTP id 026Bgq2P59310256
        (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256
 verify=OK);
        Fri, 6 Mar 2020 11:42:52 GMT
Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1])
        by IMSVA (Postfix) with ESMTP id 755AA42041;
        Fri,  6 Mar 2020 11:42:52 +0000 (GMT)
Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1])
        by IMSVA (Postfix) with ESMTP id 4C96542042;
        Fri,  6 Mar 2020 11:42:52 +0000 (GMT)
Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9])
        by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP;
        Fri,  6 Mar 2020 11:42:52 +0000 (GMT)
From: Stefan Raspl <raspl@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: rkrcmar@redhat.com, pbonzini@redhat.com
Subject: [PATCH 1/7] tools/kvm_stat: rework command line sequence and message
 texts
Date: Fri,  6 Mar 2020 12:42:44 +0100
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20200306114250.57585-1-raspl@linux.ibm.com>
References: <20200306114250.57585-1-raspl@linux.ibm.com>
X-TM-AS-GCONF: 00
x-cbid: 20030611-0016-0000-0000-000002EDC083
X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused
x-cbparentid: 20030611-0017-0000-0000-000033511847
Message-Id: <20200306114250.57585-2-raspl@linux.ibm.com>
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572
 definitions=2020-03-06_03:2020-03-06,2020-03-06 signatures=0
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 bulkscore=0
 mlxscore=0 priorityscore=1501 suspectscore=1 lowpriorityscore=0
 clxscore=1015 malwarescore=0 impostorscore=0 phishscore=0 mlxlogscore=999
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2001150001 definitions=main-2003060084
Sender: kvm-owner@vger.kernel.org
Precedence: bulk
List-ID: <kvm.vger.kernel.org>
X-Mailing-List: kvm@vger.kernel.org

From: Stefan Raspl <raspl@de.ibm.com>

Make sure command line arguments are sorted alphabetically
everywhere, and adjusted existing texts for interactive command 's' to
become consistent with the long form --set-delay.
Throwing in some PEP8 fixes (all cosmetics) for good measure.

Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
---
 tools/kvm/kvm_stat/kvm_stat     |  9 ++++----
 tools/kvm/kvm_stat/kvm_stat.txt | 40 ++++++++++++++++-----------------
 2 files changed, 25 insertions(+), 24 deletions(-)

```
#### [PATCH v3 1/5] x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit
##### From: Jon Doron <arilou@gmail.com>

```c
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Jon Doron <arilou@gmail.com>
X-Patchwork-Id: 11424311
Return-Path: <SRS0=b048=4X=vger.kernel.org=kvm-owner@kernel.org>
Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org
 [172.30.200.123])
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E58E792A
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 16:39:12 +0000 (UTC)
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
	by mail.kernel.org (Postfix) with ESMTP id BBF612073D
	for <patchwork-kvm@patchwork.kernel.org>;
 Fri,  6 Mar 2020 16:39:12 +0000 (UTC)
Authentication-Results: mail.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com
 header.b="ZNWeuQFw"
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
        id S1726879AbgCFQjM (ORCPT
        <rfc822;patchwork-kvm@patchwork.kernel.org>);
        Fri, 6 Mar 2020 11:39:12 -0500
Received: from mail-wr1-f66.google.com ([209.85.221.66]:33705 "EHLO
        mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
        with ESMTP id S1725873AbgCFQjL (ORCPT <rfc822;kvm@vger.kernel.org>);
        Fri, 6 Mar 2020 11:39:11 -0500
Received: by mail-wr1-f66.google.com with SMTP id x7so3139610wrr.0;
        Fri, 06 Mar 2020 08:39:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=from:to:cc:subject:date:message-id:in-reply-to:references
         :mime-version:content-transfer-encoding;
        bh=cqBaz7Pqcjvqd8BzE+nwXVxffgaDXzbn0ymPrZ8bx5I=;
        b=ZNWeuQFwBIvTe8w5V1YJ7K5Z6Uu46S0ZxGEZAY4hVwRfR305Iu/gbeKfetnAfBNPgI
         8DzwxVoXrZUQ2NFGEq7plXlQHolqW+qSNR4ehqjlUNm3bdhyFOSeuMVVHh+U/PduMNlT
         n75b04c8DeJbXpcl18LinJ07xHBbS0Rhx1cuOSvwnxYK7r6Op4Aub+IAkwSQRC8oqs5/
         tx6OeVom0IetxxCro0quRNTy+T3ypiGa26ogoaJsPjnKm9ZWc67GqVPf1IDz777fSQwm
         85TPnF34t+l25w63hgf6ek3xBpPXp08T7mHZiqz/wD8c+1ca5TASle1ytUTGZV7afNIq
         9Gzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
         :references:mime-version:content-transfer-encoding;
        bh=cqBaz7Pqcjvqd8BzE+nwXVxffgaDXzbn0ymPrZ8bx5I=;
        b=N24onkn78bekmvRkr+j0aTAkL6M85MIJhjeg2aRK6zbm60/++gNR1S9iof2EloA40L
         Zo6Lk1h2d4SloiHLZrJvnplg8oUg3NWDbqwKvAhFbAeyRmQvWKb95h1wIrQcASKGIcGP
         yKuU43Jlt4q1uohruKrbI5wi17l4iDhSZ0u77R+VmbXqbd0AHv3AMwv3qQ0NIls0swUi
         6EyuLEoJ69UtUp0kkThoFfzHvanN6tx3ZXU9kIFAxqqMm9orwg/5cRL7Re0qMVEw/E8W
         1hL8M7zo9TEozU+bnB+Qe/HwN7JwQs2XHv0fJ6IoQvrB1QC9LPjMyZjpIrdeFV4Tax/S
         xEQw==
X-Gm-Message-State: ANhLgQ0klXP/Q6RZHoUeSRDM7r8uFsX3Xn5USXyV0yypCPoz/G9ukaFl
        HAykQCDQ6OzMnPjS1bb8OdOYG5s9
X-Google-Smtp-Source:
 ADFU+vu8PM8BfB/3tnpmAnl4QkKt8nOdKP/pQ6jqE9wlHwfOK4XvbbLSVru+j194LDNaN8YJVuc/lQ==
X-Received: by 2002:a5d:410a:: with SMTP id l10mr4491955wrp.380.1583512750017;
        Fri, 06 Mar 2020 08:39:10 -0800 (PST)
Received: from linux.local ([199.203.162.213])
        by smtp.gmail.com with ESMTPSA id
 n24sm8812760wra.61.2020.03.06.08.39.08
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 06 Mar 2020 08:39:09 -0800 (PST)
From: Jon Doron <arilou@gmail.com>
To: kvm@vger.kernel.org, linux-hyperv@vger.kernel.org
Cc: vkuznets@redhat.com, Jon Doron <arilou@gmail.com>
Subject: [PATCH v3 1/5] x86/kvm/hyper-v: Explicitly align hcall param for
 kvm_hyperv_exit
Date: Fri,  6 Mar 2020 18:39:05 +0200
Message-Id: <20200306163909.1020369-2-arilou@gmail.com>
X-Mailer: git-send-email 2.24.1
In-Reply-To: <20200306163909.1020369-1-arilou@gmail.com>
References: <20200306163909.1020369-1-arilou@gmail.com>
MIME-Version: 1.0
Sender: kvm-owner@vger.kernel.org
Precedence: bulk
List-ID: <kvm.vger.kernel.org>
X-Mailing-List: kvm@vger.kernel.org

Signed-off-by: Jon Doron <arilou@gmail.com>
---
 include/uapi/linux/kvm.h | 1 +
 1 file changed, 1 insertion(+)

```


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:landicorp="http://schemas.android.com/apk/res-auto"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="200dp"
              android:background="@mipmap/dialog"
              android:gravity="center"
              android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:layout_marginTop="50dip"
        android:layout_weight="3"
        android:gravity="center"
        android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/waiting_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:orientation="vertical" >

            <com.landicorp.android.wofupay.widget.WaveBgProgress
                android:id="@+id/progress_wait"
                android:layout_width="180dp"
                android:layout_height="180dp"
                android:padding="5dp"
                android:layout_marginBottom="50dp"
                app:custom_bg="@mipmap/logowf"
                app:custom_color="#fedcba"
                app:custom_front="@mipmap/logocolor"
                app:custom_loop="true" />

            <TextView
                android:id="@+id/textview_info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="left"

                android:gravity="center"
                android:text="正在执行中,请稍后..."
                android:textColor="#000000"
                android:textSize="30dip" />
            <!--
            <ProgressBar
                android:id="@+id/progress_wait"
                style="@style/progress_wait"
                android:layout_width="match_parent"
                android:layout_height="30dip"
                android:layout_gravity="center" />
            -->

        </LinearLayout>

        <com.landicorp.android.wofupay.widget.InputView
            android:id="@+id/inputview0"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            landicorp:refrence="false" >
        </com.landicorp.android.wofupay.widget.InputView>

        <com.landicorp.android.wofupay.widget.InputView
            android:id="@+id/inputview1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dip"
            landicorp:refrence="false" >
        </com.landicorp.android.wofupay.widget.InputView>

        <com.landicorp.android.wofupay.widget.InputView
            android:id="@+id/inputview2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dip"
            landicorp:refrence="false" >
        </com.landicorp.android.wofupay.widget.InputView>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/bt_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginLeft="10dip"
        android:layout_marginRight="10dip"
        android:layout_weight="1"
        android:gravity="center"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/button_cancel"
            android:layout_width="80dip"
            android:layout_height="80dip"
            android:layout_marginRight="15dip"
            android:background="@drawable/normal_cancel_state"
            android:focusable="false"
            android:gravity="center"
            android:text="@string/cancel"
            android:textColor="#ffffff"
            android:textSize="20sp" />

        <Button
            android:id="@+id/button_ok"
            android:layout_width="80dip"
            android:layout_height="80dip"
            android:background="@drawable/normal_ok_state"
            android:focusable="false"
            android:gravity="center"
            android:text="@string/sure"
            android:textColor="#ffffff"
            android:textSize="20sp" />
    </LinearLayout>

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
package cli

import (
	"github.com/stretchr/testify/require"

	"testing"
)

func TestStepCallsDo(t *testing.T) {
	called := false
	step := &step{
		do: func() {
			called = true
		},
	}

	step.run(nil)

	require.True(t, called, "Step's do wasn't called")
}

func TestStepCallsSuccessAfterDo(t *testing.T) {
	calls := 0
	step := &step{
		do: func() {
			require.Equal(t, 0, calls, "Do should be called first")
			calls++
		},
		success: &step{
			do: func() {
				require.Equal(t, 1, calls, "Success should be called second")
				calls++
			},
		},
		error: &step{
			do: func() {
				t.Fatalf("Error should not have been called")
			},
		},
	}

	step.run(nil)

	require.Equal(t, 2, calls, "Both do and success should be called")
}

func TestStepCallsErrorIfDoPanics(t *testing.T) {
	defer func() { recover() }()
	calls := 0
	step := &step{
		do: func() {
			require.Equal(t, 0, calls, "Do should be called first")
			calls++
			panic(42)
		},
		success: &step{
			do: func() {
				t.Fatalf("Success should not have been called")
			},
		},
		error: &step{
			do: func() {
				require.Equal(t, 1, calls, "Error should be called second")
				calls++
			},
		},
	}

	step.run(nil)

	require.Equal(t, 2, calls, "Both do and error should be called")
}

func TestStepCallsOsExitIfAskedTo(t *testing.T) {
	exitCalled := false
	defer exitShouldBeCalledWith(t, 42, &exitCalled)()

	step := &step{}

	step.run(exit(42))

	require.True(t, exitCalled, "should have called exit")
}

func TestStepRethrowsPanic(t *testing.T) {
	defer func() {
		require.Equal(t, 42, recover(), "should panicked with the same value")
	}()

	step := &step{}

	step.run(42)

	t.Fatalf("Should have panicked")
}

func TestStepShouldNopIfNoSuccessNorPanic(t *testing.T) {
	defer exitShouldNotCalled(t)()

	step := &step{}

	step.run(nil)
}

func TestBeforeAndAfterFlowOrder(t *testing.T) {
	counter := 0

	app := App("app", "")

	app.Before = callChecker(t, 0, &counter)
	app.Command("c", "", func(c *Cmd) {
		c.Before = callChecker(t, 1, &counter)
		c.Command("cc", "", func(cc *Cmd) {
			cc.Before = callChecker(t, 2, &counter)
			cc.Action = callChecker(t, 3, &counter)
			cc.After = callChecker(t, 4, &counter)
		})
		c.After = callChecker(t, 5, &counter)
	})
	app.After = callChecker(t, 6, &counter)

	app.Run([]string{"app", "c", "cc"})
	require.Equal(t, 7, counter)
}

func TestBeforeAndAfterFlowOrderWhenOneBeforePanics(t *testing.T) {
	defer func() {
		recover()
	}()

	counter := 0

	app := App("app", "")

	app.Before = callChecker(t, 0, &counter)
	app.Command("c", "", func(c *Cmd) {
		c.Before = callChecker(t, 1, &counter)
		c.Command("cc", "", func(cc *Cmd) {
			cc.Before = callCheckerAndPanic(t, 42, 2, &counter)
			cc.Action = func() {
				t.Fatalf("should not have been called")
			}
			cc.After = func() {
				t.Fatalf("should not have been called")
			}
		})
		c.After = callChecker(t, 3, &counter)
	})
	app.After = callChecker(t, 4, &counter)

	app.Run([]string{"app", "c", "cc"})
	require.Equal(t, 5, counter)
}

func TestBeforeAndAfterFlowOrderWhenOneAfterPanics(t *testing.T) {
	defer func() {
		e := recover()
		require.Equal(t, 42, e)
	}()

	counter := 0

	app := App("app", "")

	app.Before = callChecker(t, 0, &counter)
	app.Command("c", "", func(c *Cmd) {
		c.Before = callChecker(t, 1, &counter)
		c.Command("cc", "", func(cc *Cmd) {
			cc.Before = callChecker(t, 2, &counter)
			cc.Action = callChecker(t, 3, &counter)
			cc.After = callCheckerAndPanic(t, 42, 4, &counter)
		})
		c.After = callChecker(t, 5, &counter)
	})
	app.After = callChecker(t, 6, &counter)

	app.Run([]string{"app", "c", "cc"})
	require.Equal(t, 7, counter)
}

func TestBeforeAndAfterFlowOrderWhenMultipleAftersPanic(t *testing.T) {
	defer func() {
		e := recover()
		require.Equal(t, 666, e)
	}()

	counter := 0

	app := App("app", "")

	app.Before = callChecker(t, 0, &counter)
	app.Command("c", "", func(c *Cmd) {
		c.Before = callChecker(t, 1, &counter)
		c.Command("cc", "", func(cc *Cmd) {
			cc.Before = callChecker(t, 2, &counter)
			cc.Action = callChecker(t, 3, &counter)
			cc.After = callCheckerAndPanic(t, 42, 4, &counter)
		})
		c.After = callChecker(t, 5, &counter)
	})
	app.After = callCheckerAndPanic(t, 666, 6, &counter)

	app.Run([]string{"app", "c", "cc"})
	require.Equal(t, 7, counter)
}

func TestCommandAction(t *testing.T) {

	called := false

	app := App("app", "")

	app.Command("a", "", ActionCommand(func() { called = true }))

	app.Run([]string{"app", "a"})

	require.True(t, called, "commandAction should be called")

}

func callChecker(t *testing.T, wanted int, counter *int) func() {
	return func() {
		t.Logf("checker: wanted: %d, got %d", wanted, *counter)
		require.Equal(t, wanted, *counter)
		*counter++
	}
}

func callCheckerAndPanic(t *testing.T, panicValue interface{}, wanted int, counter *int) func() {
	return func() {
		t.Logf("checker: wanted: %d, got %d", wanted, *counter)
		require.Equal(t, wanted, *counter)
		*counter++
		panic(panicValue)
	}
}


text:
#region Copyright

#endregion

namespace NerdyDuck.CodedExceptions.Configuration;

/// <summary>
/// Extends the <see cref="AssemblyDebugModeCache" /> class with methods to easily add debug mode settings from various sources.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static class AssemblyDebugModeCacheAppConfigExtensions
{
	/// <summary>
	/// Loads a list of assembly debug mode settings from the application configuration file (app.config / web.config) and adds them to the cache.
	/// </summary>
	/// <param name="cache">The cache to add the settings to.</param>
	/// <remarks>The settings are loaded from the default section 'nerdyDuck/codedExceptions'.</remarks>
	public static AssemblyDebugModeCache LoadApplicationConfiguration(this AssemblyDebugModeCache cache)
	{
		ExtensionHelper.AssertCache(cache);
		List<AssemblyDebugMode>? adm = CodedExceptionsSection.GetDebugModes();
		if (adm is not null)
		{
			cache.AddRange(adm);
		}

		return cache;
	}

	/// <summary>
	/// Loads a list of assembly debug mode settings from the specified section of the application configuration file (app.config / web.config) and adds them to the cache.
	/// </summary>
	/// <param name="cache">The cache to add the settings to.</param>
	/// <param name="sectionName">The name of the section in the application configuration file.</param>
	public static AssemblyDebugModeCache LoadApplicationConfiguration(this AssemblyDebugModeCache cache, string sectionName)
	{
		ExtensionHelper.AssertCache(cache);
		ExtensionHelper.AssertSectionName(sectionName);
		List<AssemblyDebugMode>? adm = CodedExceptionsSection.GetDebugModes(sectionName);
		if (adm is not null)
		{
			cache.AddRange(adm);
		}

		return cache;
	}
}


text:
package ru.org.linux.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
import ru.org.linux.auth.AccessViolationException;
import ru.org.linux.site.Template;
import scala.Option;

import javax.servlet.ServletRequest;

@Controller
@RequestMapping("/people/{nick}/remark")
public class EditRemarkController {
  @Autowired
  private UserService userService;

  @Autowired
  private RemarkDao remarkDao;

  @RequestMapping(method=RequestMethod.GET)
  public ModelAndView showForm(ServletRequest request, @PathVariable String nick) throws Exception {
    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized");
    }

    ModelAndView mv = new ModelAndView("edit-remark");

    User user = userService.getUserCached(nick);
    if (tmpl.isSessionAuthorized() && !tmpl.getNick().equals(nick) ) {
      Option<Remark> remark = remarkDao.getRemark(tmpl.getCurrentUser(), user);
      if (remark.isDefined()) {
        mv.getModel().put("remark", remark.get());
      }
    } else {
      throw new AccessViolationException("Not Authorized");
    }
    return mv;
  }

  @RequestMapping(method=RequestMethod.POST)
  public ModelAndView editProfile(
          ServletRequest request,
          @RequestParam("text") String text,
          @PathVariable String nick
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized");
    }
    if(text.length()>255){
      text=text.substring(0,255);
    }
    User user = tmpl.getCurrentUser();
    User refUser = userService.getUserCached(nick);
    remarkDao.setOrUpdateRemark(user, refUser, text);

    return new ModelAndView(new RedirectView("/people/" + nick + "/profile"));
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2020 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
   -->

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="red_style_name" msgid="3422019812492418917">"Estilo vermello"</string>
    <string name="green_style_name" msgid="1807715891527319248">"Estilo verde"</string>
    <string name="colors_style_setting" msgid="7410336396317170889">"Cores"</string>
    <string name="colors_style_setting_description" msgid="4961811355700378894">"Cores da esfera"</string>
    <string name="colors_style_red" msgid="1284998271677973320">"Vermello"</string>
    <string name="colors_style_green" msgid="1327609154689015139">"Verde"</string>
    <string name="colors_style_blue" msgid="8619157586474982343">"Azul"</string>
    <string name="watchface_pips_setting" msgid="486515623723087644">"Puntos das horas"</string>
    <string name="watchface_pips_setting_description" msgid="651887190185401130">"Indica se se mostran"</string>
    <string name="watchface_hand_length_setting" msgid="7998526424509601034">"Agullas: lonxitude"</string>
    <string name="watchface_hand_length_setting_description" msgid="9060532706860425059">"Escala das agullas"</string>
    <string name="watchface_complications_setting" msgid="7605635862096204587">"Complicacións"</string>
    <string name="watchface_complications_setting_description" msgid="3565604049641117847">"Número e posición"</string>
    <string name="watchface_complications_setting_both" msgid="1869848592349112126">"Ambas"</string>
    <string name="watchface_complications_setting_none" msgid="722694346696596744">"Ningunha"</string>
    <string name="watchface_complications_setting_left" msgid="1623162625339223972">"Esquerda"</string>
    <string name="watchface_complications_setting_right" msgid="3310633126129770902">"Dereita"</string>
</resources>


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('profiles', '0002_auto_20160503_1539'),
    ]

    operations = [
        migrations.RenameField(
            model_name='profile',
            old_name='perferred_name',
            new_name='preferred_name',
        ),
    ]


text:
var debug = require('debug')('botkit:onboarding');

module.exports = function(controller) {

    controller.on('onboard', function(bot) {
        debug('Starting an onboarding experience!');
        bot.startPrivateConversation({user: bot.config.createdBy},function(err,convo) {
            if (err) {
            console.log(err);
            } else {
            convo.say('I am a bot that has just joined your team');
            convo.say('You must now /invite me to a channel so that I can be of use!');
            }
        });
    });

}


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BTDB.Buffer;
using BTDB.StreamLayer;

namespace BTDB.KVDBLayer
{
    class ChunkStorageInKV : IChunkStorage
    {
        struct StorageValue
        {
            internal uint FileId;
            internal uint FileOfs;
            internal uint ContentLengthCompressedIsLeaf;
            internal uint ContentLength
            {
                get { return ContentLengthCompressedIsLeaf / 4; }
                set { ContentLengthCompressedIsLeaf = (ContentLengthCompressedIsLeaf & 1) + value * 4; }
            }

            internal bool Compressed
            {
                get { return (ContentLengthCompressedIsLeaf & 2) != 0; }
                set
                {
                    if (value) ContentLengthCompressedIsLeaf |= 2u; else ContentLengthCompressedIsLeaf &= ~2u;
                }
            }

            internal bool Leaf
            {
                get { return (ContentLengthCompressedIsLeaf & 1) != 0; }
                set
                {
                    if (value) ContentLengthCompressedIsLeaf |= 1u; else ContentLengthCompressedIsLeaf &= ~1u;
                }
            }
        }

        readonly long _subDBId;
        readonly IFileCollectionWithFileInfos _fileCollection;
        readonly long _maxFileSize;
        volatile int _keyLen;
        readonly ConcurrentDictionary<ByteStructs.Key20, StorageValue> _dict20 = new ConcurrentDictionary<ByteStructs.Key20, StorageValue>(new ByteStructs.Key20EqualityComparer());
        readonly object _pureValueFileLock = new object();
        IFileCollectionFile _pureValueFile;
        AbstractBufferedWriter _pureValueFileWriter;
        IFileCollectionFile _hashIndexFile;
        AbstractBufferedWriter _hashIndexWriter;

        public ChunkStorageInKV(long subDBId, IFileCollectionWithFileInfos fileCollection, long maxFileSize)
        {
            _subDBId = subDBId;
            _fileCollection = fileCollection;
            _maxFileSize = maxFileSize;
            _keyLen = -1;
            LoadFiles();
        }

        void LoadFiles()
        {
            var hashKeyIndexFiles = new List<KeyValuePair<uint, long>>();
            var fileIdOfLastPureValues = 0u;
            var generationOfLastPureValues = 0L;
            foreach (var pair in _fileCollection.FileInfos)
            {
                if (pair.Value.SubDBId != _subDBId) continue;
                if (pair.Value.FileType == KVFileType.PureValuesWithId)
                {
                    if (generationOfLastPureValues < pair.Value.Generation)
                    {
                        generationOfLastPureValues = pair.Value.Generation;
                        fileIdOfLastPureValues = pair.Key;
                    }
                }
                else if (pair.Value.FileType == KVFileType.HashKeyIndex)
                {
                    hashKeyIndexFiles.Add(new KeyValuePair<uint, long>(pair.Key, pair.Value.Generation));
                }
            }
            if (hashKeyIndexFiles.Count == 0)
                return;
            hashKeyIndexFiles.Sort((x, y) => x.Value < y.Value ? -1 : x.Value > y.Value ? 1 : 0);
            TryLoadHashKeyIndex(hashKeyIndexFiles[hashKeyIndexFiles.Count - 1].Key);
        }

        bool TryLoadHashKeyIndex(uint hashKeyIndexFileId)
        {
            var reader = _fileCollection.GetFile(hashKeyIndexFileId).GetExclusiveReader();
            _keyLen = (int) ((IHashKeyIndex)_fileCollection.FileInfoByIdx(hashKeyIndexFileId)).KeyLen;
            HashKeyIndex.SkipHeader(reader);
            var keyBuf = ByteBuffer.NewSync(new byte[_keyLen]);
            while (!reader.Eof)
            {
                var value = new StorageValue();
                value.FileId = reader.ReadVUInt32();
                value.FileOfs = reader.ReadVUInt32();
                value.ContentLengthCompressedIsLeaf = reader.ReadVUInt32();
                reader.ReadBlock(keyBuf);
                _dict20.TryAdd(new ByteStructs.Key20(keyBuf), value);
            }
            return true;
        }

        void CheckOrInitKeyLen(int keyLen)
        {
            if (_keyLen == -1)
            {
                if (keyLen != 20) throw new ArgumentException("Length of Key must be 20 bytes");
#pragma warning disable 420
                Interlocked.CompareExchange(ref _keyLen, keyLen, -1);
#pragma warning restore 420
            }
            if (_keyLen != keyLen)
            {
                throw new ArgumentException("Key length is different from stored");
            }
        }

        public IChunkStorageTransaction StartTransaction()
        {
            return new ChunkStorageTransaction(this);
        }

        class ChunkStorageTransaction : IChunkStorageTransaction
        {
            readonly ChunkStorageInKV _chunkStorageInKV;

            public ChunkStorageTransaction(ChunkStorageInKV chunkStorageInKV)
            {
                _chunkStorageInKV = chunkStorageInKV;
            }

            public void Dispose()
            {
                lock (_chunkStorageInKV._pureValueFileLock)
                {
                    _chunkStorageInKV.FlushFiles();
                }
            }

            public void Put(ByteBuffer key, ByteBuffer content, bool isLeaf)
            {
                _chunkStorageInKV.CheckOrInitKeyLen(key.Length);
                var key20 = new ByteStructs.Key20(key);
                var d = _chunkStorageInKV._dict20;
                StorageValue val;
            again:
                if (d.TryGetValue(key20, out val))
                {
                    if (val.ContentLength != content.Length) throw new InvalidOperationException("Hash collision or error in memory");
                    if (!isLeaf && val.Leaf)
                    {
                        var newval = val;
                        newval.Leaf = false;
                        if (!d.TryUpdate(key20, newval, val)) goto again;
                        lock (_chunkStorageInKV._pureValueFileLock)
                        {
                            _chunkStorageInKV.StoreHashUpdate(key, newval);
                        }
                    }
                    return;
                }
                lock (_chunkStorageInKV._pureValueFileLock)
                {
                    val = _chunkStorageInKV.StoreContent(content);
                    val.Leaf = isLeaf;
                    if (!d.TryAdd(key20, val))
                    {
                        goto again;
                    }
                    _chunkStorageInKV.StoreHashUpdate(key, val);
                }
            }

            public Task<ByteBuffer> Get(ByteBuffer key)
            {
                _chunkStorageInKV.CheckOrInitKeyLen(key.Length);
                var tcs = new TaskCompletionSource<ByteBuffer>();
                var key20 = new ByteStructs.Key20(key);
                var d = _chunkStorageInKV._dict20;
                StorageValue val;
                if (d.TryGetValue(key20, out val))
                {
                    var buf = new byte[val.ContentLength];
                    _chunkStorageInKV._fileCollection.GetFile(val.FileId).RandomRead(buf, 0, buf.Length, val.FileOfs);
                    tcs.SetResult(ByteBuffer.NewAsync(buf));
                }
                else
                {
                    tcs.SetResult(ByteBuffer.NewEmpty());
                }
                return tcs.Task;
            }
        }

        void FlushFiles()
        {
            if (_pureValueFileWriter != null)
            {
                _pureValueFileWriter.FlushBuffer();
                _pureValueFile.HardFlush();
            }
            if (_hashIndexWriter != null)
            {
                _hashIndexWriter.FlushBuffer();
                _hashIndexFile.HardFlush();
            }
        }

        StorageValue StoreContent(ByteBuffer content)
        {
            var result = new StorageValue();
            result.Compressed = false;
            result.ContentLength = (uint)content.Length;
            if (_pureValueFile == null)
                StartNewPureValueFile();
            result.FileId = _pureValueFile.Index;
            result.FileOfs = (uint)_pureValueFileWriter.GetCurrentPosition();
            _pureValueFileWriter.WriteBlock(content);
            if (_pureValueFileWriter.GetCurrentPosition() >= _maxFileSize)
            {
                _pureValueFileWriter.FlushBuffer();
                StartNewPureValueFile();
            }
            return result;
        }

        void StartNewPureValueFile()
        {
            _pureValueFile = _fileCollection.AddFile("hpv");
            _pureValueFileWriter = _pureValueFile.GetAppenderWriter();
            var fileInfo = new FilePureValuesWithId(_subDBId, _fileCollection.NextGeneration());
            fileInfo.WriteHeader(_pureValueFileWriter);
            _fileCollection.SetInfo(_pureValueFile.Index, fileInfo);
        }

        void StoreHashUpdate(ByteBuffer key, StorageValue storageValue)
        {
            if (_hashIndexWriter == null)
            {
                StartNewHashIndexFile();
            }
            _hashIndexWriter.WriteVUInt32(storageValue.FileId);
            _hashIndexWriter.WriteVUInt32(storageValue.FileOfs);
            _hashIndexWriter.WriteVUInt32(storageValue.ContentLengthCompressedIsLeaf);
            _hashIndexWriter.WriteBlock(key);
        }

        void StartNewHashIndexFile()
        {
            _hashIndexFile = _fileCollection.AddFile("hid");
            _hashIndexWriter = _hashIndexFile.GetAppenderWriter();
            var fileInfo = new HashKeyIndex(_subDBId, _fileCollection.NextGeneration(), (uint)_keyLen);
            fileInfo.WriteHeader(_hashIndexWriter);
            _fileCollection.SetInfo(_hashIndexFile.Index, fileInfo);
        }
    }
}


text:
package org.apache.drill.common.expression.visitors;

import org.apache.drill.common.expression.BooleanOperator;
import org.apache.drill.common.expression.CastExpression;
import org.apache.drill.common.expression.ConvertExpression;
import org.apache.drill.common.expression.ErrorCollector;
import org.apache.drill.common.expression.FunctionCall;
import org.apache.drill.common.expression.FunctionHolderExpression;
import org.apache.drill.common.expression.IfExpression;
import org.apache.drill.common.expression.IfExpression.IfCondition;
import org.apache.drill.common.expression.LogicalExpression;
import org.apache.drill.common.expression.NullExpression;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.expression.TypedFieldExpr;
import org.apache.drill.common.expression.TypedNullConstant;
import org.apache.drill.common.expression.ValueExpressions;
import org.apache.drill.common.expression.ValueExpressions.BooleanExpression;
import org.apache.drill.common.expression.ValueExpressions.DateExpression;
import org.apache.drill.common.expression.ValueExpressions.Decimal18Expression;
import org.apache.drill.common.expression.ValueExpressions.Decimal28Expression;
import org.apache.drill.common.expression.ValueExpressions.Decimal38Expression;
import org.apache.drill.common.expression.ValueExpressions.Decimal9Expression;
import org.apache.drill.common.expression.ValueExpressions.DoubleExpression;
import org.apache.drill.common.expression.ValueExpressions.IntervalDayExpression;
import org.apache.drill.common.expression.ValueExpressions.IntervalYearExpression;
import org.apache.drill.common.expression.ValueExpressions.LongExpression;
import org.apache.drill.common.expression.ValueExpressions.QuotedString;
import org.apache.drill.common.expression.ValueExpressions.TimeExpression;
import org.apache.drill.common.expression.ValueExpressions.TimeStampExpression;
import org.apache.drill.common.expression.ValueExpressions.VarDecimalExpression;
import org.apache.drill.common.types.TypeProtos.DataMode;
import org.apache.drill.common.types.TypeProtos.MajorType;
import org.apache.drill.common.types.TypeProtos.MinorType;

public class ExpressionValidator implements ExprVisitor<Void, ErrorCollector, RuntimeException> {
  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ExpressionValidator.class);

  @Override
  public Void visitFunctionCall(FunctionCall call, ErrorCollector errors) throws RuntimeException {
    // we throw an exception here because this is a fundamental operator programming problem as opposed to an expression
    // problem. At this point in an expression's lifecycle, all function calls should have been converted into
    // FunctionHolders.
    throw new UnsupportedOperationException("FunctionCall is not expected here. "
        + "It should have been converted to FunctionHolderExpression in materialization");
  }

  @Override
  public Void visitFunctionHolderExpression(FunctionHolderExpression holder, ErrorCollector errors)
      throws RuntimeException {
    // make sure aggregate functions are not nested inside aggregate functions
    AggregateChecker.isAggregating(holder, errors);

    // make sure arguments are constant if the function implementation expects constants for any arguments
    ConstantChecker.checkConstants(holder, errors);

    return null;
  }

  @Override
  public Void visitBooleanOperator(BooleanOperator op, ErrorCollector errors) throws RuntimeException {
    int i = 0;
    for (LogicalExpression arg : op.args) {
      if ( arg.getMajorType().getMinorType() != MinorType.BIT) {
        errors
            .addGeneralError(
                arg.getPosition(),
                String
                    .format(
                        "Failure composing boolean operator %s.  All conditions must return a boolean type.  Condition %d was of Type %s.",
                        op.getName(), i, arg.getMajorType().getMinorType()));
      }
      i++;
    }

    return null;
  }

  @Override
  public Void visitIfExpression(IfExpression ifExpr, ErrorCollector errors) throws RuntimeException {
    // confirm that all conditions are required boolean values.
    IfCondition cond = ifExpr.ifCondition;
    MajorType majorType = cond.condition.getMajorType();
    if ( majorType
        .getMinorType() != MinorType.BIT) {
      errors
          .addGeneralError(
              cond.condition.getPosition(),
              String
                  .format(
                      "Failure composing If Expression.  All conditions must return a boolean type.  Condition was of Type %s.",
                      majorType.getMinorType()));
    }

    // confirm that all outcomes are the same type.
    final MajorType mt = ifExpr.elseExpression.getMajorType();
    cond = ifExpr.ifCondition;
    MajorType innerT = cond.expression.getMajorType();
    if ((innerT.getMode() == DataMode.REPEATED && mt.getMode() != DataMode.REPEATED) || //
        ((innerT.getMinorType() != mt.getMinorType()) &&
        (innerT.getMode() != DataMode.OPTIONAL && mt.getMode() != DataMode.OPTIONAL &&
        (innerT.getMinorType() != MinorType.NULL && mt.getMinorType() != MinorType.NULL)))) {
      errors
          .addGeneralError(
              cond.condition.getPosition(),
              String
                  .format(
                      "Failure composing If Expression.  All expressions must return the same MinorType as the else expression.  The if condition returned type type %s but the else expression was of type %s",
                      innerT, mt));
    }
    return null;
  }

  @Override
  public Void visitSchemaPath(SchemaPath path, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitIntConstant(ValueExpressions.IntExpression intExpr, ErrorCollector value) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitFloatConstant(ValueExpressions.FloatExpression fExpr, ErrorCollector value) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitLongConstant(LongExpression intExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitDecimal9Constant(Decimal9Expression decExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitDecimal18Constant(Decimal18Expression decExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitDecimal28Constant(Decimal28Expression decExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitDecimal38Constant(Decimal38Expression decExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitVarDecimalConstant(VarDecimalExpression decExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitDateConstant(DateExpression intExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitTimeConstant(TimeExpression intExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitIntervalYearConstant(IntervalYearExpression intExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitIntervalDayConstant(IntervalDayExpression intExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitTimeStampConstant(TimeStampExpression intExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitDoubleConstant(DoubleExpression dExpr, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitBooleanConstant(BooleanExpression e, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitQuotedStringConstant(QuotedString e, ErrorCollector errors) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitUnknown(LogicalExpression e, ErrorCollector value) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitCastExpression(CastExpression e, ErrorCollector value) throws RuntimeException {
    return e.getInput().accept(this, value);
  }

  @Override
  public Void visitNullConstant(TypedNullConstant e, ErrorCollector value) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitNullExpression(NullExpression e, ErrorCollector value) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitConvertExpression(ConvertExpression e, ErrorCollector value)
      throws RuntimeException {
    return e.getInput().accept(this, value);
  }

  @Override
  public Void visitParameter(ValueExpressions.ParameterExpression e, ErrorCollector value) throws RuntimeException {
    return null;
  }

  @Override
  public Void visitTypedFieldExpr(TypedFieldExpr e, ErrorCollector value) throws RuntimeException {
    return null;
  }
}


text:
package org.apache.river.api.lookup;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import net.jini.lookup.entry.Address;
import net.jini.lookup.entry.Comment;
import net.jini.lookup.entry.Location;
import net.jini.lookup.entry.Name;
import net.jini.lookup.entry.ServiceInfo;
import net.jini.lookup.entry.Status;
import net.jini.lookup.entry.UIDescriptor;

/**
 * A little builder utility class that creates an array of Entry classes to
 * be used as a parameter for StreamServiceRegistrar.  All the jini platform
 * Entry's are included by default.
 *
 * Note: This class is not threadsafe, use external synchronization if required.
 *
 * Suggested by Dan Creswell.
 *
 * @since 2.2.1
 */
public class DefaultEntries {
    private final Set<Class> entrys;

    public DefaultEntries() {
        entrys = new HashSet<Class>(16);
    }
    /**
     * Add an Entry class.
     * @param cl - class
     * @return this
     */
    public DefaultEntries add(Class cl){
        entrys.add(cl);
        return this;
    }
    /**
     * All all the Jini Platform Entry's
     * @return
     */
    public DefaultEntries addPlatformEntries(){
        add(Comment.class);
        add(Location.class);
        add(Name.class);
        add(ServiceInfo.class);
        add(Status.class);
        add(UIDescriptor.class);
        add(Address.class);
        return this;
    }
    /**
     * Remove all Entry's
     */
    public void reset(){
        entrys.clear();
    }

    /**
     * Generate a new array containing all Entry's added since last reset.
     * @return
     */
    public Class[] getEntries(){
        return entrys.toArray(new Class[entrys.size()]);
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 29 * hash + (this.entrys != null ? this.entrys.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object o){
        if (o == null) return false;
        if (o instanceof DefaultEntries){
            if (entrys.equals(((DefaultEntries)o).entrys)) return true;
        }
        return false;
    }

    @Override
    public String toString(){
        String newline = System.getProperty("line.separator");
        StringBuilder sb = new StringBuilder(256);
        sb.append("DefaultEntries:");
        sb.append(newline);
        Iterator<Class> it = entrys.iterator();
        while (it.hasNext()){
            sb.append(it.next().getName());
            sb.append(newline);
        }
        return sb.toString();
    }
}


text:
local ColorPicker = {} -- implements ColorControllerInterface

function ColorPicker:getColor()
    return remote.call("color-picker", "get_color", self.colorPicker)
end

function ColorPicker:getHex()
    return remote.call("color-picker", "get_hex_color", self.colorPicker)
end

function ColorPicker:setColor(color)
    remote.call("color-picker", "set_color", self.colorPicker, color)
end

function ColorPicker:setHex(hex)
    remote.call("color-picker", "set_hex_color", self.colorPicker, hex)
end

function ColorPicker:getType()
    return RailwayPainterConstants.ColorControllers.PICKER
end

function ColorPicker:destroy()
    self.colorPicker.destroy()
end

function ColorPicker.new(parentElement)
    local self = Object.new(ColorPicker)
    self.colorPicker = remote.call("color-picker", "add_instance", {
        parent = parentElement,
        container_name = RPName("color_picker")
    })
    return self
end

return ColorPicker


text:
Class.forName({
  name: "class js.util.Entry extends Object",
  "private _key": null,
  "private _value": null,
  Entry: function(key, value) {
    this._key = key;
    this._value = value;
  },
  "clone": function() {
    var key = this._key ? this._key.clone() : this._key;
    var value = this._value ? this._value.clone() : this._value;
    return new js.util.Entry(key, value);
  },
  getKey: function() {
    return this._key;
  },
  getValue: function() {
    return this._value;
  },
  setValue: function(val) {
    this._value = _val;
  }
});


text:
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["photoSize", "direction"],
  _excluded2 = ["photos", "visibleCount", "count", "size", "layout", "children", "className"];
import * as React from "react";
import { hasReactNode } from "../../lib/utils";
import { classNamesString } from "../../lib/classNames";
import { Footnote } from "../Typography/Footnote/Footnote";
import { Caption } from "../Typography/Caption/Caption";
import { useId } from "../../hooks/useId";
import "./UsersStack.module.css";
function PathElement(_ref) {
  var photoSize = _ref.photoSize,
    direction = _ref.direction,
    props = _objectWithoutProperties(_ref, _excluded);
  switch (direction) {
    case "circle":
      var radius = photoSize / 2;
      return /*#__PURE__*/React.createElement("circle", _extends({
        cx: radius,
        cy: radius,
        r: radius
      }, props));
    case "right":
      switch (photoSize) {
        case 24:
          return /*#__PURE__*/React.createElement("path", _extends({
            d: "M22,18.625A12 12 0 0 1 12 24A12 12 0 0 1 12 0A12 12 0 0 1 22 5.375A12 12 0 0 0 22,18.625"
          }, props));
        default:
          return /*#__PURE__*/React.createElement("path", _extends({
            d: "M30,23.75A16 16 0 0 1 16 32A16 16 0 0 1 16 0A16 16 0 0 1 30 8.25A16 16 0 0 0 30,23.75"
          }, props));
      }
    default:
      switch (photoSize) {
        case 16:
          return /*#__PURE__*/React.createElement("path", _extends({
            d: "M2,13.285A8 8 0 0 0 8 16A8 8 0 0 0 8 0A8 8 0 0 0 2 2.715A8 8 0 0 1 2,13.285"
          }, props));
        case 24:
          return /*#__PURE__*/React.createElement("path", _extends({
            d: "M2,18.625A12 12 0 0 0 12 24A12 12 0 0 0 12 0A12 12 0 0 0 2 5.375A12 12 0 0 1 2,18.625"
          }, props));
        default:
          return /*#__PURE__*/React.createElement("path", _extends({
            d: "M2,23.75A16 16 0 0 0 16 32A16 16 0 0 0 16 0A16 16 0 0 0 2 8.25A16 16 0 0 1 2,23.75"
          }, props));
      }
  }
}
var photoSizes = {
  s: 16,
  m: 24,
  l: 32
};

/**
 * @see https://vkcom.github.io/VKUI/#/UsersStack
 */
export var UsersStack = function UsersStack(_ref2) {
  var _ref2$photos = _ref2.photos,
    photos = _ref2$photos === void 0 ? [] : _ref2$photos,
    _ref2$visibleCount = _ref2.visibleCount,
    visibleCount = _ref2$visibleCount === void 0 ? 3 : _ref2$visibleCount,
    _ref2$count = _ref2.count,
    count = _ref2$count === void 0 ? Math.max(0, photos.length - visibleCount) : _ref2$count,
    _ref2$size = _ref2.size,
    size = _ref2$size === void 0 ? "m" : _ref2$size,
    _ref2$layout = _ref2.layout,
    layout = _ref2$layout === void 0 ? "horizontal" : _ref2$layout,
    children = _ref2.children,
    className = _ref2.className,
    restProps = _objectWithoutProperties(_ref2, _excluded2);
  var cmpId = useId();
  var canShowOthers = count > 0 && size !== "s";
  var CounterTypography = size === "m" ? Footnote : Caption;
  var photoSize = photoSizes[size];
  var directionClip = canShowOthers ? "right" : "left";
  var photosElements = photos.slice(0, visibleCount).map(function (photo, i) {
    var direction = i === 0 && !canShowOthers ? "circle" : directionClip;
    var id = "UsersStackDefs".concat(cmpId).concat(i);
    var hrefID = "#".concat(id);
    var maskID = "UsersStackMask".concat(cmpId).concat(i);
    return /*#__PURE__*/React.createElement("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      className: "vkuiUsersStack__photo",
      key: i,
      "aria-hidden": true
    }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement(PathElement, {
      id: id,
      direction: direction,
      photoSize: photoSize
    })), /*#__PURE__*/React.createElement("clipPath", {
      id: maskID
    }, /*#__PURE__*/React.createElement("use", {
      href: hrefID
    })), /*#__PURE__*/React.createElement("g", {
      clipPath: "url(#".concat(maskID, ")")
    }, /*#__PURE__*/React.createElement("use", {
      href: hrefID,
      className: "vkuiUsersStack__fill"
    }), /*#__PURE__*/React.createElement("image", {
      href: photo,
      width: photoSize,
      height: photoSize
    }), /*#__PURE__*/React.createElement("use", {
      href: hrefID,
      fill: "none",
      stroke: "rgba(0, 0, 0, 0.08)"
    })));
  });
  var othersElement = canShowOthers ? /*#__PURE__*/React.createElement(CounterTypography, {
    caps: true,
    weight: "1",
    className: classNamesString("vkuiUsersStack__photo", "vkuiUsersStack__photo--others"),
    "aria-hidden": true
  }, /*#__PURE__*/React.createElement("span", null, "+", count)) : null;
  return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
    className: classNamesString("vkuiUsersStack", styles["UsersStack--size-".concat(size)], styles["UsersStack--layout-".concat(layout)], canShowOthers && "vkuiUsersStack--others", className)
  }), (photosElements.length > 0 || othersElement) && /*#__PURE__*/React.createElement("div", {
    className: "vkuiUsersStack__photos",
    role: "presentation"
  }, photosElements, othersElement), hasReactNode(children) && /*#__PURE__*/React.createElement(Footnote, {
    className: "vkuiUsersStack__text"
  }, children));
};
var styles = {
  "UsersStack--size-s": "vkuiUsersStack--size-s",
  "UsersStack--size-m": "vkuiUsersStack--size-m",
  "UsersStack--size-l": "vkuiUsersStack--size-l",
  "UsersStack--layout-vertical": "vkuiUsersStack--layout-vertical",
  "UsersStack--layout-horizontal": "vkuiUsersStack--layout-horizontal"
};
//# sourceMappingURL=UsersStack.js.map


text:
<meta charset="UTF-8">
<title>OrthographicAcronymModelTrainer.setLongformsPath - biomedicus-core</title>
<link rel="stylesheet" href="../../../style.css">

biomedicus-core / edu.umn.biomedicus.acronym / OrthographicAcronymModelTrainer / setLongformsPath

setLongformsPath

open fun setLongformsPath(longformsPath: Path): Unit


text:
import {
  createStore,
  combineReducers,
}                               from 'redux';
import * as reducers            from '../reducers';
import Immutable                from 'seamless-immutable';

export default function () {
  const reducer = combineReducers(reducers);
  const initialState = Immutable({});

  return createStore(reducer, initialState);
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Layout filename: ''</title>
    <link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../assets/validation.css">

test/fixtures/pages/yfm/relational-trees.hbs →
            test/actual/yfm/relational-trees.html

          First

          ← Previous

          1

          2

          3

          4

          5

          6

          7

          8

          9

          10

          Last

          Next →

                First

                ← Previous

 1

 2

 3

 4

 5

 6

 7

                8

 9

 10

                Next →

                Last

                Page layout: default.hbs

                Page src: test/fixtures/pages/yfm/relational-trees.hbs

                Page dest: test/actual/yfm/relational-trees.html

                Dest filename: relational-trees.html

                Dest basename: relational-trees

                Page title: Relational Trees - References

Relational Trees - References

Associative arrays

instrument

Lasik 2000

pulseEnergy

5.4

pulseDuration

12

repetition

1000

spotSize

1mm

instrument

Lasik 2000

pulseEnergy

5

pulseDuration

10

repetition

500

spotSize

2mm

instrument

Lasik 2000

pulseEnergy

5.4

pulseDuration

12

repetition

1000

spotSize

1mm

instrument

Lasik 2000

pulseEnergy

5

pulseDuration

10

repetition

500

spotSize

2mm

instrument

Lasik 2000

pulseEnergy

5.4

pulseDuration

12

repetition

1000

spotSize

1mm

instrument

Lasik 2000

pulseEnergy

5

pulseDuration

10

repetition

500

spotSize

2mm

Content

 associative-arrays.html

 block-literals.html

 comments.html

 data-files.html

 data-types.html

 document.html

 lists.html

 relational-trees.html

 underscore.html

 variables.html

Page

Each pages

 associative-arrays

 block-literals

 comments

 data-files

 data-types

 document

 lists

 relational-trees

 underscore

 variables

Debug Info

{
  "_page": "all",
  "assets": "../../assets",
  "basename": "relational-trees",
  "data": {
    "title": "Relational Trees - References",
    "steps": [
      {
        "step": {
          "instrument": "Lasik 2000",
          "pulseEnergy": 5.4,
          "pulseDuration": 12,
          "repetition": 1000,
          "spotSize": "1mm"
        }
      },
      {
        "step": {
          "instrument": "Lasik 2000",
          "pulseEnergy": 5,
          "pulseDuration": 10,
          "repetition": 500,
          "spotSize": "2mm"
        }
      },
      {
        "step": {
          "instrument": "Lasik 2000",
          "pulseEnergy": 5.4,
          "pulseDuration": 12,
          "repetition": 1000,
          "spotSize": "1mm"
        }
      },
      {
        "step": {
          "instrument": "Lasik 2000",
          "pulseEnergy": 5,
          "pulseDuration": 10,
          "repetition": 500,
          "spotSize": "2mm"
        }
      },
      {
        "step": {
          "instrument": "Lasik 2000",
          "pulseEnergy": 5.4,
          "pulseDuration": 12,
          "repetition": 1000,
          "spotSize": "1mm"
        }
      },
      {
        "step": {
          "instrument": "Lasik 2000",
          "pulseEnergy": 5,
          "pulseDuration": 10,
          "repetition": 500,
          "spotSize": "2mm"
        }
      }
    ]
  },
  "dest": "test/actual/yfm/relational-trees.html",
  "dirname": "test/actual/yfm",
  "ext": ".html",
  "extname": ".html",
  "filePair": {
    "src": [
      "test/fixtures/pages/yfm/associative-arrays.hbs",
      "test/fixtures/pages/yfm/block-literals.hbs",
      "test/fixtures/pages/yfm/comments.hbs",
      "test/fixtures/pages/yfm/data-files.hbs",
      "test/fixtures/pages/yfm/data-types.hbs",
      "test/fixtures/pages/yfm/document.hbs",
      "test/fixtures/pages/yfm/lists.hbs",
      "test/fixtures/pages/yfm/relational-trees.hbs",
      "test/fixtures/pages/yfm/underscore.hbs",
      "test/fixtures/pages/yfm/variables.hbs"
    ],
    "dest": "test/actual/yfm/",
    "orig": {
      "src": [
        "test/fixtures/pages/yfm/*.hbs"
      ],
      "dest": "test/actual/yfm/"
    }
  },
  "filename": "relational-trees.html",
  "first": false,
  "index": 7,
  "last": false,
  "middle": true,
  "next": 8,
  "number": 8,
  "page": "\n
\n
{{{title}}}
 \n
\n\n
\n
Associative arrays
\n
\n    {{#each steps}}\n      {{#each step}}\n
{{@key}}
 \n
{{.}}
\n      {{/each}}\n
\n    {{/each}}\n
\n
",
  "pageName": "relational-trees.html",
  "pagename": "relational-trees.html",
  "prev": 6,
  "src": "test/fixtures/pages/yfm/relational-trees.hbs",
  "steps": [
    {
      "step": {
        "instrument": "Lasik 2000",
        "pulseEnergy": 5.4,
        "pulseDuration": 12,
        "repetition": 1000,
        "spotSize": "1mm"
      }
    },
    {
      "step": {
        "instrument": "Lasik 2000",
        "pulseEnergy": 5,
        "pulseDuration": 10,
        "repetition": 500,
        "spotSize": "2mm"
      }
    },
    {
      "step": {
        "instrument": "Lasik 2000",
        "pulseEnergy": 5.4,
        "pulseDuration": 12,
        "repetition": 1000,
        "spotSize": "1mm"
      }
    },
    {
      "step": {
        "instrument": "Lasik 2000",
        "pulseEnergy": 5,
        "pulseDuration": 10,
        "repetition": 500,
        "spotSize": "2mm"
      }
    },
    {
      "step": {
        "instrument": "Lasik 2000",
        "pulseEnergy": 5.4,
        "pulseDuration": 12,
        "repetition": 1000,
        "spotSize": "1mm"
      }
    },
    {
      "step": {
        "instrument": "Lasik 2000",
        "pulseEnergy": 5,
        "pulseDuration": 10,
        "repetition": 500,
        "spotSize": "2mm"
      }
    }
  ],
  "title": "Relational Trees - References"
}


text:
namespace blink {

using testing::Contains;
using testing::Eq;
using testing::ByRef;
using base::trace_event::MemoryAllocatorDump;

// Tests that the Chromium<>Blink plumbing that exposes the MemoryInfra classes
// behaves correctly, performs the right transfers of memory ownerships and
// doesn't leak objects.
TEST(WebProcessMemoryDumpTest, IntegrationTest) {
  std::unique_ptr<base::trace_event::TracedValue> traced_value(
      new base::trace_event::TracedValue());

  std::unique_ptr<WebProcessMemoryDump> wpmd1(new WebProcessMemoryDump());
  auto* wmad1 = wpmd1->CreateMemoryAllocatorDump("1/1");
  auto* wmad2 = wpmd1->CreateMemoryAllocatorDump("1/2");
  ASSERT_EQ(wmad1, wpmd1->GetMemoryAllocatorDump("1/1"));
  ASSERT_EQ(wmad2, wpmd1->GetMemoryAllocatorDump("1/2"));

  std::unique_ptr<WebProcessMemoryDump> wpmd2(new WebProcessMemoryDump());
  wpmd2->CreateMemoryAllocatorDump("2/1");
  wpmd2->CreateMemoryAllocatorDump("2/2");

  wpmd1->TakeAllDumpsFrom(wpmd2.get());

  // Make sure that wpmd2 still owns its own PMD, even if empty.
  ASSERT_NE(static_cast<base::trace_event::ProcessMemoryDump*>(nullptr),
            wpmd2->process_memory_dump_);
  ASSERT_EQ(wpmd2->owned_process_memory_dump_.get(),
            wpmd2->process_memory_dump());
  ASSERT_TRUE(wpmd2->process_memory_dump()->allocator_dumps().empty());

  // Make sure that wpmd2 is still usable after it has been emptied.
  auto* wmad = wpmd2->CreateMemoryAllocatorDump("2/new");
  wmad->AddScalar("attr_name", "bytes", 42);
  ASSERT_EQ(1u, wpmd2->process_memory_dump()->allocator_dumps().size());
  auto* mad = wpmd2->process_memory_dump()->GetAllocatorDump("2/new");
  ASSERT_NE(static_cast<MemoryAllocatorDump*>(nullptr), mad);
  ASSERT_EQ(wmad, wpmd2->GetMemoryAllocatorDump("2/new"));

  // Check that the attributes are propagated correctly.
  MemoryAllocatorDump::Entry expected("attr_name", "bytes", 42);
  ASSERT_THAT(mad->entries(), Contains(Eq(ByRef(expected))));

  // Check that calling serialization routines doesn't cause a crash.
  wpmd2->process_memory_dump()->SerializeAllocatorDumpsInto(traced_value.get());

  // Free the |wpmd2| to check that the memory ownership of the two MAD(s)
  // has been transferred to |wpmd1|.
  wpmd2.reset();

  // Now check that |wpmd1| has been effectively merged.
  ASSERT_EQ(4u, wpmd1->process_memory_dump()->allocator_dumps().size());
  ASSERT_EQ(1u, wpmd1->process_memory_dump()->allocator_dumps().count("1/1"));
  ASSERT_EQ(1u, wpmd1->process_memory_dump()->allocator_dumps().count("1/2"));
  ASSERT_EQ(1u, wpmd1->process_memory_dump()->allocator_dumps().count("2/1"));
  ASSERT_EQ(1u, wpmd1->process_memory_dump()->allocator_dumps().count("1/2"));

  // Check that also the WMAD wrappers got merged.
  blink::WebMemoryAllocatorDump* null_wmad = nullptr;
  ASSERT_NE(null_wmad, wpmd1->GetMemoryAllocatorDump("1/1"));
  ASSERT_NE(null_wmad, wpmd1->GetMemoryAllocatorDump("1/2"));
  ASSERT_NE(null_wmad, wpmd1->GetMemoryAllocatorDump("2/1"));
  ASSERT_NE(null_wmad, wpmd1->GetMemoryAllocatorDump("2/2"));

  // Check that calling serialization routines doesn't cause a crash.
  traced_value = std::make_unique<base::trace_event::TracedValue>();
  wpmd1->process_memory_dump()->SerializeAllocatorDumpsInto(traced_value.get());

  // Check that clear() actually works.
  wpmd1->Clear();
  ASSERT_TRUE(wpmd1->process_memory_dump()->allocator_dumps().empty());
  ASSERT_EQ(nullptr, wpmd1->process_memory_dump()->GetAllocatorDump("1/1"));
  ASSERT_EQ(nullptr, wpmd1->process_memory_dump()->GetAllocatorDump("2/1"));

  // Check that calling serialization routines doesn't cause a crash.
  traced_value = std::make_unique<base::trace_event::TracedValue>();
  wpmd1->process_memory_dump()->SerializeAllocatorDumpsInto(traced_value.get());

  // Check if a WebMemoryAllocatorDump created with guid, has correct guid.
  blink::WebMemoryAllocatorDumpGuid guid =
      base::trace_event::MemoryAllocatorDumpGuid("id_1").ToUint64();
  auto* wmad3 = wpmd1->CreateMemoryAllocatorDump("1/3", guid);
  ASSERT_EQ(wmad3->Guid(), guid);
  ASSERT_EQ(wmad3, wpmd1->GetMemoryAllocatorDump("1/3"));

  // Check that AddOwnershipEdge is propagated correctly.
  auto* wmad4 = wpmd1->CreateMemoryAllocatorDump("1/4");
  wpmd1->AddOwnershipEdge(wmad4->Guid(), guid);
  auto allocator_dumps_edges =
      wpmd1->process_memory_dump()->allocator_dumps_edges();
  ASSERT_EQ(1u, allocator_dumps_edges.size());
  auto it = allocator_dumps_edges.begin();
  ASSERT_NE(allocator_dumps_edges.end(), it);
  ASSERT_EQ(wmad4->Guid(), it->first.ToUint64());
  ASSERT_EQ(guid, it->second.target.ToUint64());

  // Check that createDumpAdapterForSkia() works.
  auto* skia_trace_memory_dump = wpmd1->CreateDumpAdapterForSkia("1/skia");
  ASSERT_TRUE(skia_trace_memory_dump);

  // Check that createDiscardableMemoryAllocatorDump() works.
  base::TestDiscardableMemoryAllocator discardable_memory_allocator;
  auto discardable_memory =
      discardable_memory_allocator.AllocateLockedDiscardableMemory(1024);
  wpmd1->CreateDiscardableMemoryAllocatorDump("1/discardable",
                                              discardable_memory.get());
  discardable_memory->Unlock();

  wpmd1.reset();
}

}  // namespace blink


text:
set -euo pipefail

VERSION=$(cat azure-application-insights-archives/version)

cp azure-application-insights-archives/applicationinsights-agent-*.jar repository/azure-application-insights-$VERSION.jar
cp azure-application-insights-archives/version repository/version


text:
namespace ProgrammingLanguage {
    using namespace clang::ast_matchers;
    //match do statement
    extern StatementMatcher gotoStmtMatcherPL;

    class GotoStmtPrinter : public MatchFinder::MatchCallback {
    public:
        virtual void run(const MatchFinder::MatchResult &Result);
    };
}
#endif