Skip to content

Commit

Permalink
Merged main:4e0e79dd349a into amd-gfx:edf208676d23
Browse files Browse the repository at this point in the history
Local branch amd-gfx edf2086 Merged main:ce8c59e6af48 into amd-gfx:33a7a3576da9
Remote branch main 4e0e79d [lldb] Simplify some lldb-server tests
  • Loading branch information
Sw authored and Sw committed Jan 6, 2021
2 parents edf2086 + 4e0e79d commit ab07f2c
Show file tree
Hide file tree
Showing 26 changed files with 126 additions and 151 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
81 changes: 12 additions & 69 deletions lldb/test/API/tools/lldb-server/TestGdbRemoteAuxvSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,16 @@
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):

mydir = TestBase.compute_mydir(__file__)

AUXV_SUPPORT_FEATURE_NAME = "qXfer:auxv:read"

def has_auxv_support(self):
inferior_args = ["message:main entered", "sleep:5"]
procs = self.prep_debug_monitor_and_inferior(
inferior_args=inferior_args)

# Don't do anything until we match the launched inferior main entry output.
# Then immediately interrupt the process.
# This prevents auxv data being asked for before it's ready and leaves
# us in a stopped state.
self.test_sequence.add_log_lines([
# Start the inferior...
"read packet: $c#63",
# ... match output....
{"type": "output_match", "regex": self.maybe_strict_output_regex(
r"message:main entered\r\n")},
], True)
# ... then interrupt.
self.add_interrupt_packets()
self.add_qSupported_packets()
procs = self.prep_debug_monitor_and_inferior()

self.add_qSupported_packets()
context = self.expect_gdbremote_sequence()
self.assertIsNotNone(context)

Expand Down Expand Up @@ -87,27 +70,19 @@ def get_raw_auxv_data(self):
self.assertIsNotNone(content_raw)
return (word_size, self.decode_gdbremote_binary(content_raw))

def supports_auxv(self):
# When non-auxv platforms support llgs, skip the test on platforms
# that don't support auxv.
@skipIfWindows # no auxv support.
@skipIfDarwin
def test_supports_auxv(self):
self.build()
self.set_inferior_startup_launch()
self.assertTrue(self.has_auxv_support())

#
# We skip the "supports_auxv" test on debugserver. The rest of the tests
# appropriately skip the auxv tests if the support flag is not present
# in the qSupported response, so the debugserver test bits are still there
# in case debugserver code one day does have auxv support and thus those
# tests don't get skipped.
#

@skipIfWindows # no auxv support.
@llgs_test
def test_supports_auxv_llgs(self):
@skipIfWindows
@expectedFailureNetBSD
def test_auxv_data_is_correct_size(self):
self.build()
self.set_inferior_startup_launch()
self.supports_auxv()

def auxv_data_is_correct_size(self):
(word_size, auxv_data) = self.get_raw_auxv_data()
self.assertIsNotNone(auxv_data)

Expand All @@ -116,21 +91,12 @@ def auxv_data_is_correct_size(self):
self.assertEqual(len(auxv_data) % (2 * word_size), 0)
self.trace("auxv contains {} entries".format(len(auxv_data) / (2*word_size)))

@debugserver_test
def test_auxv_data_is_correct_size_debugserver(self):
self.build()
self.set_inferior_startup_launch()
self.auxv_data_is_correct_size()

@skipIfWindows
@expectedFailureNetBSD
@llgs_test
def test_auxv_data_is_correct_size_llgs(self):
def test_auxv_keys_look_valid(self):
self.build()
self.set_inferior_startup_launch()
self.auxv_data_is_correct_size()

def auxv_keys_look_valid(self):
(word_size, auxv_data) = self.get_raw_auxv_data()
self.assertIsNotNone(auxv_data)

Expand All @@ -154,21 +120,12 @@ def auxv_keys_look_valid(self):
self.assertTrue(auxv_key <= 1000)
self.trace("auxv dict: {}".format(auxv_dict))

@debugserver_test
def test_auxv_keys_look_valid_debugserver(self):
self.build()
self.set_inferior_startup_launch()
self.auxv_keys_look_valid()

@skipIfWindows
@expectedFailureNetBSD
@llgs_test
def test_auxv_keys_look_valid_llgs(self):
def test_auxv_chunked_reads_work(self):
self.build()
self.set_inferior_startup_launch()
self.auxv_keys_look_valid()

def auxv_chunked_reads_work(self):
# Verify that multiple smaller offset,length reads of auxv data
# return the same data as a single larger read.

Expand Down Expand Up @@ -200,17 +157,3 @@ def auxv_chunked_reads_work(self):

# Verify both types of data collection returned same content.
self.assertEqual(auxv_dict_iterated, auxv_dict)

@debugserver_test
def test_auxv_chunked_reads_work_debugserver(self):
self.build()
self.set_inferior_startup_launch()
self.auxv_chunked_reads_work()

@skipIfWindows
@expectedFailureNetBSD
@llgs_test
def test_auxv_chunked_reads_work_llgs(self):
self.build()
self.set_inferior_startup_launch()
self.auxv_chunked_reads_work()
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import xml.etree.ElementTree as ET

import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *


class TestGdbRemoteLibrariesSvr4Support(gdbremote_testcase.GdbRemoteTestCaseBase):

mydir = TestBase.compute_mydir(__file__)
Expand Down Expand Up @@ -104,27 +102,23 @@ def libraries_svr4_libs_present(self):
for lib in self.get_expected_libs():
self.assertIn(os.path.realpath(self.getBuildDir() + "/" + lib), libraries_svr4_names)

@llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
def test_supports_libraries_svr4(self):
self.setup_test()
self.assertTrue(self.has_libraries_svr4_support())

@llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
@expectedFailureNetBSD
def test_libraries_svr4_well_formed(self):
self.setup_test()
self.libraries_svr4_well_formed()

@llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
@expectedFailureNetBSD
def test_libraries_svr4_load_addr(self):
self.setup_test()
self.libraries_svr4_has_correct_load_addr()

@llgs_test
@skipUnlessPlatform(["linux", "android", "freebsd", "netbsd"])
@expectedFailureNetBSD
def test_libraries_svr4_libs_present(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


supported_linux_archs = ["x86_64", "i386"]
supported_oses = ["linux", "windows"]
supported_oses = ["linux", "windows"]+lldbplatformutil.getDarwinOSTriples()

class TestGdbRemoteMemoryAllocation(gdbremote_testcase.GdbRemoteTestCaseBase):

Expand Down Expand Up @@ -47,7 +45,6 @@ def allocate(self, size, permissions):
@skipIf(oslist=no_match(supported_oses))
@skipIf(oslist=["linux"], archs=no_match(supported_linux_archs))
@expectedFailureAll(oslist=["windows"]) # Memory allocated with incorrect permissions
@llgs_test
def test_supported(self):
"""Make sure (de)allocation works on platforms where it's supposed to
work"""
Expand All @@ -62,7 +59,6 @@ def test_supported(self):

@skipIf(oslist=["linux"], archs=supported_linux_archs)
@skipIf(oslist=supported_oses)
@llgs_test
def test_unsupported(self):
"""Make sure we get an "unsupported" error on platforms where the
feature is not implemented."""
Expand All @@ -77,7 +73,6 @@ def test_unsupported(self):
True)
self.expect_gdbremote_sequence()

@llgs_test
def test_bad_packet(self):
"""Make sure we get a proper error for malformed packets."""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@


import gdbremote_testcase
import textwrap
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


def _extract_register_value(reg_info, reg_bank, byte_order, bytes_per_entry=8):
reg_offset = int(reg_info["offset"])*2
reg_byte_size = int(2 * int(reg_info["bitsize"]) / 8)
Expand All @@ -29,7 +26,9 @@ class TestGdbRemoteGPacket(gdbremote_testcase.GdbRemoteTestCaseBase):

mydir = TestBase.compute_mydir(__file__)

def run_test_g_packet(self):
@skipIfOutOfTreeDebugserver
@skipUnlessDarwin # G packet not supported
def test_g_packet(self):
self.build()
self.prep_debug_monitor_and_inferior()
self.test_sequence.add_log_lines(
Expand All @@ -49,11 +48,6 @@ def run_test_g_packet(self):
context = self.expect_gdbremote_sequence()
self.assertNotEqual(context.get("G_reply")[0], 'E')

@skipIfOutOfTreeDebugserver
@debugserver_test
def test_g_packet_debugserver(self):
self.run_test_g_packet()

@skipIf(archs=no_match(["x86_64"]))
def g_returns_correct_data(self, with_suffix):
procs = self.prep_debug_monitor_and_inferior()
Expand Down Expand Up @@ -136,16 +130,14 @@ def g_returns_correct_data(self, with_suffix):

@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48420")
@expectedFailureNetBSD
@llgs_test
def test_g_returns_correct_data_with_suffix_llgs(self):
def test_g_returns_correct_data_with_suffix(self):
self.build()
self.set_inferior_startup_launch()
self.g_returns_correct_data(True)

@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48420")
@expectedFailureNetBSD
@llgs_test
def test_g_returns_correct_data_no_suffix_llgs(self):
def test_g_returns_correct_data_no_suffix(self):
self.build()
self.set_inferior_startup_launch()
self.g_returns_correct_data(False)
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class TestGdbRemoteThreadName(gdbremote_testcase.GdbRemoteTestCaseBase):

mydir = TestBase.compute_mydir(__file__)
Expand All @@ -29,7 +27,6 @@ def run_and_check_name(self, expected_name):
self.assertEqual(expected_name, kv_dict.get("name"))

@skipIfWindows # the test is not updated for Windows.
@llgs_test
def test(self):
""" Make sure lldb-server can retrieve inferior thread name"""
self.build()
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Config/llvm-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/* Indicate that this is LLVM compiled from the amd-gfx branch. */
#define LLVM_HAVE_BRANCH_AMD_GFX
#define LLVM_MAIN_REVISION 376246

/* Define if LLVM_ENABLE_DUMP is enabled */
#cmakedefine LLVM_ENABLE_DUMP
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ProfileData/SampleProfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h"
Expand All @@ -247,6 +246,7 @@
namespace llvm {

class raw_ostream;
class Twine;

namespace sampleprof {

Expand Down Expand Up @@ -408,7 +408,7 @@ class SampleProfileReader {
StringMap<FunctionSamples> &getProfiles() { return Profiles; }

/// Report a parse error message.
void reportError(int64_t LineNumber, Twine Msg) const {
void reportError(int64_t LineNumber, const Twine &Msg) const {
Ctx.diagnose(DiagnosticInfoSampleProfile(Buffer->getBufferIdentifier(),
LineNumber, Msg));
}
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ class MipsAsmParser : public MCTargetAsmParser {
bool expandSaaAddr(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
const MCSubtargetInfo *STI);

bool reportParseError(Twine ErrorMsg);
bool reportParseError(SMLoc Loc, Twine ErrorMsg);
bool reportParseError(const Twine &ErrorMsg);
bool reportParseError(SMLoc Loc, const Twine &ErrorMsg);

bool parseMemOffset(const MCExpr *&Res, bool isParenExpr);

Expand Down Expand Up @@ -6982,12 +6982,12 @@ bool MipsAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,

// FIXME: Given that these have the same name, these should both be
// consistent on affecting the Parser.
bool MipsAsmParser::reportParseError(Twine ErrorMsg) {
bool MipsAsmParser::reportParseError(const Twine &ErrorMsg) {
SMLoc Loc = getLexer().getLoc();
return Error(Loc, ErrorMsg);
}

bool MipsAsmParser::reportParseError(SMLoc Loc, Twine ErrorMsg) {
bool MipsAsmParser::reportParseError(SMLoc Loc, const Twine &ErrorMsg) {
return Error(Loc, ErrorMsg);
}

Expand Down
34 changes: 33 additions & 1 deletion llvm/test/CodeGen/Hexagon/vect/zext-v4i1.ll
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=hexagon -hexagon-instsimplify=0 < %s | FileCheck %s

; Check that this compiles successfully.
; CHECK: vcmph.eq

target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
target triple = "hexagon"

define i32 @fred(<8 x i16>* %a0) #0 {
; CHECK-LABEL: fred:
; CHECK: // %bb.0: // %b0
; CHECK-NEXT: {
; CHECK-NEXT: if (p0) jump:nt .LBB0_2
; CHECK-NEXT: }
; CHECK-NEXT: // %bb.1: // %b2
; CHECK-NEXT: {
; CHECK-NEXT: r3:2 = combine(#0,#0)
; CHECK-NEXT: r1:0 = memd(r0+#0)
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: p0 = vcmph.eq(r1:0,r3:2)
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: r1:0 = mask(p0)
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: r0 = and(r0,#1)
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: p0 = cmp.eq(r0,#11)
; CHECK-NEXT: r0 = #1
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: if (p0) r0 = #0
; CHECK-NEXT: jumpr r31
; CHECK-NEXT: }
; CHECK-NEXT: .LBB0_2: // %b14
; CHECK-NEXT: {
; CHECK-NEXT: r0 = #0
; CHECK-NEXT: jumpr r31
; CHECK-NEXT: }
b0:
switch i32 undef, label %b14 [
i32 5, label %b2
Expand Down
Loading

0 comments on commit ab07f2c

Please sign in to comment.