Skip to content

Commit

Permalink
Merged master:26a8e8502b59 into amd-gfx:8e202fa63587
Browse files Browse the repository at this point in the history
Local branch amd-gfx 8e202fa Merged master:a7bcb3b9eb76 into amd-gfx:a97870a7d652
Remote branch master 26a8e85 [lldb] Add Apple simulator platforms to lldbplatform.py
  • Loading branch information
Sw authored and Sw committed Nov 5, 2020
2 parents 8e202fa + 26a8e85 commit 23e8ff6
Show file tree
Hide file tree
Showing 75 changed files with 520 additions and 234 deletions.
8 changes: 8 additions & 0 deletions compiler-rt/test/asan/TestCases/leaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
int *t;

__attribute__((noopt)) void leak(int n) {
#if defined(__ANDROID__) || defined(__BIONIC__)
// Bionic does not acutally allocate when n==0, hence
// there would not be a leak.
// Re-adjust n so the test can pass.
if (n == 0)
n = 1;
#endif

// Repeat few times to make sure that at least one pointer is
// not somewhere on the stack.
for (int i = 0; i < 10; ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// XFAIL: c++03

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.barrier/completion.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.latch/count_down.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.semaphore/release.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
4 changes: 3 additions & 1 deletion libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++03, c++11

// This test requires the dylib support introduced in D68480
// This test requires the dylib support introduced in D68480,
// which hasn't shipped yet.
// XFAIL: with_system_cxx_lib=macosx
// XFAIL: with_system_cxx_lib=macosx10.15
// XFAIL: with_system_cxx_lib=macosx10.14
// XFAIL: with_system_cxx_lib=macosx10.13
Expand Down
6 changes: 1 addition & 5 deletions lldb/packages/Python/lldbsuite/test/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ def getArchSpec(self, architecture):
Helper function to return the key-value string to specify the architecture
used for the make system.
"""
arch = architecture if architecture else None
if not arch and configuration.arch:
arch = configuration.arch

return ("ARCH=" + arch) if arch else ""
return ("ARCH=" + architecture) if architecture else ""

def getCCSpec(self, compiler):
"""
Expand Down
14 changes: 10 additions & 4 deletions lldb/packages/Python/lldbsuite/test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,23 +551,29 @@ def is_ios_simulator():
return skipTestIfFn(is_ios_simulator)(func)

def skipIfiOS(func):
return skipIfPlatform(["ios"])(func)
return skipIfPlatform(lldbplatform.translate(lldbplatform.ios))(func)

def skipIftvOS(func):
return skipIfPlatform(["tvos"])(func)
return skipIfPlatform(lldbplatform.translate(lldbplatform.tvos))(func)

def skipIfwatchOS(func):
return skipIfPlatform(["watchos"])(func)
return skipIfPlatform(lldbplatform.translate(lldbplatform.watchos))(func)

def skipIfbridgeOS(func):
return skipIfPlatform(["bridgeos"])(func)
return skipIfPlatform(lldbplatform.translate(lldbplatform.bridgeos))(func)

def skipIfDarwinEmbedded(func):
"""Decorate the item to skip tests that should be skipped on Darwin armv7/arm64 targets."""
return skipIfPlatform(
lldbplatform.translate(
lldbplatform.darwin_embedded))(func)

def skipIfDarwinSimulator(func):
"""Decorate the item to skip tests that should be skipped on Darwin simulator targets."""
return skipIfPlatform(
lldbplatform.translate(
lldbplatform.darwin_simulator))(func)

def skipIfFreeBSD(func):
"""Decorate the item to skip tests that should be skipped on FreeBSD."""
return skipIfPlatform(["freebsd"])(func)
Expand Down
4 changes: 4 additions & 0 deletions lldb/packages/Python/lldbsuite/test/lldbpexpect.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def launch(self, executable=None, extra_args=None, timeout=30, dimensions=None):
def expect(self, cmd, substrs=None):
self.assertNotIn('\n', cmd)
self.child.sendline(cmd)
# If 'substrs' is a string then this code would just check that every
# character of the string is in the output.
assert not isinstance(substrs, six.string_types), \
"substrs must be a collection of strings"
if substrs is not None:
for s in substrs:
self.child.expect_exact(s)
Expand Down
19 changes: 12 additions & 7 deletions lldb/packages/Python/lldbsuite/test/lldbplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@
# LLDB modules
import lldb

windows, linux, macosx, darwin, ios, tvos, watchos, bridgeos, darwin_all, darwin_embedded, freebsd, netbsd, bsd_all, android = range(
14)
windows, linux, macosx, darwin, ios, tvos, watchos, bridgeos, darwin_all, \
darwin_embedded, darwin_simulator, freebsd, netbsd, bsd_all, android \
= range(15)

__darwin_embedded = ["ios", "tvos", "watchos", "bridgeos"]
__darwin_simulators = ["iphonesimulator", "watchsimulator", "appletvsimulator"]

__name_lookup = {
windows: ["windows"],
linux: ["linux"],
macosx: ["macosx"],
darwin: ["darwin"],
ios: ["ios"],
tvos: ["tvos"],
watchos: ["watchos"],
ios: ["ios", "iphonesimulator"],
tvos: ["tvos", "appletvsimulator"],
watchos: ["watchos", "watchsimulator"],
bridgeos: ["bridgeos"],
darwin_all: ["macosx", "darwin", "ios", "tvos", "watchos", "bridgeos"],
darwin_embedded: ["ios", "tvos", "watchos", "bridgeos"],
darwin_all: ["macosx", "darwin"] + __darwin_embedded + __darwin_simulators,
darwin_embedded: __darwin_embedded + __darwin_simulators,
darwin_simulator: __darwin_simulators,
freebsd: ["freebsd"],
netbsd: ["netbsd"],
bsd_all: ["freebsd", "netbsd"],
Expand Down
3 changes: 1 addition & 2 deletions lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ def getHostPlatform():


def getDarwinOSTriples():
return ['darwin', 'macosx', 'ios', 'watchos', 'tvos', 'bridgeos']

return lldbplatform.translate(lldbplatform.darwin_all)

def getPlatform():
"""Returns the target platform which the tests are running on."""
Expand Down
3 changes: 3 additions & 0 deletions lldb/packages/Python/lldbsuite/test/lldbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2607,6 +2607,9 @@ def build(
"""Platform specific way to build the default binaries."""
module = builder_module()

if not architecture and configuration.arch:
architecture = configuration.arch

dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
if self.getDebugInfo() is None:
return self.buildDefault(architecture, compiler, dictionary)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def setUp(self):
@expectedFailureAndroid("http://llvm.org/pr23762", api_levels=[16])
@expectedFailureNetBSD
@skipIfReproducer # File synchronization is not supported during replay.
@skipIftvOS # fork not available on tvOS.
@skipIfwatchOS # fork not available on watchOS.
def test_setpgid(self):
self.build()
exe = self.getBuildArtifact("a.out")
Expand Down
29 changes: 29 additions & 0 deletions lldb/test/API/test_utils/TestPExpectTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
Test the PExpectTest test functions.
"""


import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
from textwrap import dedent


class TestPExpectTestCase(TestBase):

mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True

def assert_expect_fails_with(self, cmd, expect_args, expected_msg):
try:
self.expect(cmd, **expect_args)
except AssertionError as e:
self.assertIn(expected_msg, str(e))
else:
self.fail("expect should have raised AssertionError!")

def test_expect(self):
# Test that passing a string to the 'substrs' argument is rejected.
self.assert_expect_fails_with("settings list prompt",
dict(substrs="some substring"),
"substrs must be a collection of strings")
32 changes: 20 additions & 12 deletions llvm/docs/TableGen/ProgRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ Note that, unlike most languages, TableGen allows :token:`TokIdentifier` to
begin with an integer. In case of ambiguity, a token is interpreted as a
numeric literal rather than an identifier.

TableGen has the following reserved words, which cannot be used as
TableGen has the following reserved keywords, which cannot be used as
identifiers::

bit bits class code dag
def else foreach defm defset
defvar field if in include
int let list multiclass string
then
def else false foreach defm
defset defvar field if in
include int let list multiclass
string then true

.. warning::
The ``field`` reserved word is deprecated.
Expand Down Expand Up @@ -362,12 +362,20 @@ simple value is the concatenation of the strings. Code fragments become
strings and then are indistinguishable from them.

.. productionlist::
SimpleValue2: "?"
SimpleValue2: "true" | "false"

The ``true`` and ``false`` literals are essentially syntactic sugar for the
integer values 1 and 0. They improve the readability of TableGen files when
boolean values are used in field values, bit sequences, ``if`` statements.
etc. When parsed, these literals are converted to integers.

.. productionlist::
SimpleValue3: "?"

A question mark represents an uninitialized value.

.. productionlist::
SimpleValue3: "{" [`ValueList`] "}"
SimpleValue4: "{" [`ValueList`] "}"
ValueList: `ValueListNE`
ValueListNE: `Value` ("," `Value`)*

Expand All @@ -376,7 +384,7 @@ This value represents a sequence of bits, which can be used to initialize a
must represent a total of *n* bits.

.. productionlist::
SimpleValue4: "[" `ValueList` "]" ["<" `Type` ">"]
SimpleValue5: "[" `ValueList` "]" ["<" `Type` ">"]

This value is a list initializer (note the brackets). The values in brackets
are the elements of the list. The optional :token:`Type` can be used to
Expand All @@ -385,7 +393,7 @@ from the given values. TableGen can usually infer the type, although
sometimes not when the value is the empty list (``[]``).

.. productionlist::
SimpleValue5: "(" `DagArg` [`DagArgList`] ")"
SimpleValue6: "(" `DagArg` [`DagArgList`] ")"
DagArgList: `DagArg` ("," `DagArg`)*
DagArg: `Value` [":" `TokVarName`] | `TokVarName`

Expand All @@ -394,7 +402,7 @@ This represents a DAG initializer (note the parentheses). The first
See `Directed acyclic graphs (DAGs)`_ for more details.

.. productionlist::
SimpleValue6: `TokIdentifier`
SimpleValue7: `TokIdentifier`

The resulting value is the value of the entity named by the identifier. The
possible identifiers are described here, but the descriptions will make more
Expand Down Expand Up @@ -453,7 +461,7 @@ sense after reading the remainder of this guide.
def Foo#i;

.. productionlist::
SimpleValue7: `ClassID` "<" `ValueListNE` ">"
SimpleValue8: `ClassID` "<" `ValueListNE` ">"

This form creates a new anonymous record definition (as would be created by an
unnamed ``def`` inheriting from the given class with the given template
Expand All @@ -464,7 +472,7 @@ Invoking a class in this manner can provide a simple subroutine facility.
See `Using Classes as Subroutines`_ for more information.

.. productionlist::
SimpleValue8: `BangOperator` ["<" `Type` ">"] "(" `ValueListNE` ")"
SimpleValue9: `BangOperator` ["<" `Type` ">"] "(" `ValueListNE` ")"
:| `CondOperator` "(" `CondClause` ("," `CondClause`)* ")"
CondClause: `Value` ":" `Value`

Expand Down
Loading

0 comments on commit 23e8ff6

Please sign in to comment.