Skip to content

[pull] swift/main from apple:swift/main #1113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
10bc28f
[lldb/API] Expose Module::IsLoadedInTarget() to SB API (NFC)
medismailben Feb 1, 2021
bb459f1
[lldb/test] Skip `SBTarget::IsLoaded` test on windows (NFC)
medismailben Feb 1, 2021
17aea2d
Merge pull request #2403 from medismailben/apple/stable/20210107
medismailben Feb 1, 2021
a991323
[lldb] Use the host architecture in TestAppleSimulatorOSType.py
JDevlieghere Feb 2, 2021
5624161
Merge pull request #2411 from apple/🍒/ganymede/fbd55071788a3e57d2fdf8…
JDevlieghere Feb 2, 2021
7f8599b
[lldb] Convert assertTrue(a == b) to assertEqual(a, b)
kastiglione Feb 1, 2021
be752ed
[GlobalISel] Check if branches use the same MBB in matchOptBrCondByIn…
Feb 2, 2021
4e59474
[lldb/test] Stop recording fundamental return types (NFC)
medismailben Feb 3, 2021
289510f
Merge pull request #2422 from apple/PR-73842004
ornata Feb 3, 2021
2aa8348
[debugserver] Fix -Winconsistent-missing-override warnings on arm64
JDevlieghere Feb 2, 2021
6bb9786
[debugserver] Fix -Wunused-function warnings on arm64
JDevlieghere Feb 2, 2021
5b1cbcf
[debugserver] Fix -Wsign-compare warnings on arm64
JDevlieghere Feb 2, 2021
e75ecb2
[debugserver] Fix -Wmissing-field-initializers warnings on arm64
JDevlieghere Feb 2, 2021
59c26ae
Merge pull request #2420 from apple/lldb-Convert-assertTrue-a-b-to-as…
kastiglione Feb 3, 2021
a0b42b9
Merge pull request #2423 from medismailben/apple/stable/20210107
medismailben Feb 3, 2021
6b149b2
[lldb] Fix debugserver-entitlements.plist path
JDevlieghere Feb 3, 2021
0cd0854
Merge pull request #2424 from apple/🍒/ganymede/870a58a75889+9a62b7242…
JDevlieghere Feb 3, 2021
50436ad
Merge pull request #2426 from apple/🍒/ganymede/5580fa10dbda49199ddc55…
JDevlieghere Feb 3, 2021
75533d0
Fix crash when emitting NullReturn guards for functions returning BOOL
jroelofs Jan 21, 2021
f6990f6
Fix the guaranteed alignment of memory returned by malloc/new on Darwin
ahatanaka Feb 2, 2021
9003e0a
[lldb] Honor the CPU type & subtype when launching on macOS
JDevlieghere Feb 3, 2021
eff0507
Merge pull request #2427 from apple/fix-new-align
ahatanaka Feb 4, 2021
1827998
Merge pull request #2428 from apple/🍒/ganymede/98e50a7d4c12d2c32eb15e…
JDevlieghere Feb 4, 2021
73229a9
Merge commit '1827998c4799' from apple/stable/20210107 into swift/main
Feb 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clang/lib/Basic/TargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
// From the glibc documentation, on GNU systems, malloc guarantees 16-byte
// alignment on 64-bit systems and 8-byte alignment on 32-bit systems. See
// https://www.gnu.org/software/libc/manual/html_node/Malloc-Examples.html.
// This alignment guarantee also applies to Windows and Android.
// This alignment guarantee also applies to Windows and Android. On Darwin,
// the alignment is 16 bytes on both 64-bit and 32-bit systems.
if (T.isGNUEnvironment() || T.isWindowsMSVCEnvironment() || T.isAndroid())
NewAlign = Triple.isArch64Bit() ? 128 : Triple.isArch32Bit() ? 64 : 0;
else if (T.isOSDarwin())
NewAlign = 128;
else
NewAlign = 0; // Infer from basic type alignment.
HalfWidth = 16;
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/CodeGen/CGObjCMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,8 @@ struct NullReturnState {
// If we've got a scalar return, build a phi.
if (result.isScalar()) {
// Derive the null-initialization value.
llvm::Constant *null = CGF.CGM.EmitNullConstant(resultType);
llvm::Value *null =
CGF.EmitFromMemory(CGF.CGM.EmitNullConstant(resultType), resultType);

// If no join is necessary, just flow out.
if (!contBB) return RValue::get(null);
Expand Down
38 changes: 38 additions & 0 deletions clang/test/CodeGenObjC/null-check-bool-ret.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// RUN: %clang_cc1 -triple arm64e-apple-ios15.0.0 -emit-llvm-bc -fobjc-arc -disable-llvm-passes %s -emit-llvm -o - | FileCheck %s

// rdar://73361264

@protocol NSObject
@end

@interface NSObject <NSObject>
@end

@interface WidgetTester : NSObject
@end

@implementation WidgetTester

typedef struct {
NSObject* impl;
} widget_t;

- (_Bool)withWidget:(widget_t)widget {
return 0;
}

- (_Bool)testWidget:(widget_t)widget {
return [self withWidget:widget];
}

@end

// CHECK-LABEL: msgSend.call:
// CHECK: [[CALL:%[^ ]+]] = call i1 bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to
// CHECK-NEXT: br label %msgSend.cont

// CHECK-LABEL: msgSend.null-receiver:
// CHECK: br label %msgSend.cont

// CHECK-LABEL: msgSend.cont:
// CHECK-NEXT: {{%[^ ]+}} = phi i1 [ [[CALL]], %msgSend.call ], [ false, %msgSend.null-receiver ]
3 changes: 3 additions & 0 deletions clang/test/Preprocessor/init-aarch64.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@
// AARCH64-DARWIN: #define __WINT_WIDTH__ 32
// AARCH64-DARWIN: #define __aarch64__ 1

// RUN: %clang_cc1 -E -dM -triple=aarch64-apple-ios7.0 -x c++ < /dev/null | FileCheck -match-full-lines -check-prefix AARCH64-DARWIN-CXX %s
// AARCH64-DARWIN-CXX: #define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL

// RUN: %clang_cc1 -E -dM -ffreestanding -triple=aarch64-windows-msvc < /dev/null | FileCheck -match-full-lines -check-prefix AARCH64-MSVC %s

// AARCH64-MSVC: #define _INTEGRAL_MAX_BITS 64
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Preprocessor/init-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
// ARM:#define __arm 1
// ARM:#define __arm__ 1

// RUN: %clang_cc1 -E -dM -triple=armv7-apple-ios7.0 -x c++ < /dev/null | FileCheck -match-full-lines -check-prefix ARM-DARWIN-CXX %s
// ARM-DARWIN-CXX: #define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL

// RUN: %clang_cc1 -dM -ffreestanding -triple arm-none-none -target-abi apcs-gnu -E /dev/null -o - | FileCheck -match-full-lines -check-prefix ARM-APCS-GNU %s
// ARM-APCS-GNU: #define __INTPTR_TYPE__ int
// ARM-APCS-GNU: #define __PTRDIFF_TYPE__ int
Expand Down
10 changes: 10 additions & 0 deletions lldb/bindings/interface/SBTarget.i
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,16 @@ public:
lldb::addr_t
GetStackRedZoneSize();

%feature("docstring", "
Returns true if the module has been loaded in this `SBTarget`.
A module can be loaded either by the dynamic loader or by being manually
added to the target (see `SBTarget.AddModule` and the `target module add` command).

:rtype: bool
") IsLoaded;
bool
IsLoaded (const lldb::SBModule &module) const;

lldb::SBLaunchInfo
GetLaunchInfo () const;

Expand Down
2 changes: 2 additions & 0 deletions lldb/include/lldb/API/SBTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,8 @@ class LLDB_API SBTarget {

lldb::addr_t GetStackRedZoneSize();

bool IsLoaded(const lldb::SBModule &module) const;

lldb::SBLaunchInfo GetLaunchInfo() const;

void SetLaunchInfo(const lldb::SBLaunchInfo &launch_info);
Expand Down
17 changes: 17 additions & 0 deletions lldb/source/API/SBTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,21 @@ lldb::addr_t SBTarget::GetStackRedZoneSize() {
return 0;
}

bool SBTarget::IsLoaded(const SBModule &module) const {
LLDB_RECORD_METHOD_CONST(bool, SBTarget, IsLoaded, (const lldb::SBModule &),
module);

TargetSP target_sp(GetSP());
if (!target_sp)
return false;

ModuleSP module_sp(module.GetSP());
if (!module_sp)
return false;

return module_sp->IsLoadedInTarget(target_sp.get());
}

lldb::SBLaunchInfo SBTarget::GetLaunchInfo() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBLaunchInfo, SBTarget, GetLaunchInfo);

Expand Down Expand Up @@ -2742,6 +2757,8 @@ void RegisterMethods<SBTarget>(Registry &R) {
LLDB_REGISTER_METHOD(lldb::SBValue, SBTarget, EvaluateExpression,
(const char *, const lldb::SBExpressionOptions &));
LLDB_REGISTER_METHOD(lldb::addr_t, SBTarget, GetStackRedZoneSize, ());
LLDB_REGISTER_METHOD_CONST(bool, SBTarget, IsLoaded,
(const lldb::SBModule &));
LLDB_REGISTER_METHOD_CONST(lldb::SBLaunchInfo, SBTarget, GetLaunchInfo, ());
LLDB_REGISTER_METHOD(void, SBTarget, SetLaunchInfo,
(const lldb::SBLaunchInfo &));
Expand Down
50 changes: 50 additions & 0 deletions lldb/source/Host/macosx/objcxx/Host.mm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

#include <asl.h>
#include <crt_externs.h>
#include <dlfcn.h>
#include <grp.h>
#include <libproc.h>
#include <pwd.h>
Expand Down Expand Up @@ -1108,6 +1109,55 @@ static Status LaunchProcessPosixSpawn(const char *exe_path,
}
}

// Don't set the binpref if a shell was provided. After all, that's only
// going to affect what version of the shell is launched, not what fork of
// the binary is launched. We insert "arch --arch <ARCH> as part of the
// shell invocation to do that job on OSX.
if (launch_info.GetShell() == FileSpec()) {
const ArchSpec &arch_spec = launch_info.GetArchitecture();
cpu_type_t cpu_type = arch_spec.GetMachOCPUType();
cpu_type_t cpu_subtype = arch_spec.GetMachOCPUSubType();
const bool set_cpu_type =
cpu_type != 0 && cpu_type != static_cast<cpu_type_t>(UINT32_MAX) &&
cpu_type != static_cast<cpu_type_t>(LLDB_INVALID_CPUTYPE);
const bool set_cpu_subtype =
cpu_subtype != 0 &&
cpu_subtype != static_cast<cpu_subtype_t>(UINT32_MAX) &&
cpu_subtype != CPU_SUBTYPE_X86_64_H;
if (set_cpu_type) {
size_t ocount = 0;
typedef int (*posix_spawnattr_setarchpref_np_t)(
posix_spawnattr_t *, size_t, cpu_type_t *, cpu_subtype_t *, size_t *);
posix_spawnattr_setarchpref_np_t posix_spawnattr_setarchpref_np_fn =
(posix_spawnattr_setarchpref_np_t)dlsym(
RTLD_DEFAULT, "posix_spawnattr_setarchpref_np");
if (set_cpu_subtype && posix_spawnattr_setarchpref_np_fn) {
error.SetError((*posix_spawnattr_setarchpref_np_fn)(
&attr, 1, &cpu_type, &cpu_subtype, &ocount),
eErrorTypePOSIX);
if (error.Fail())
LLDB_LOG(log,
"error: {0}, ::posix_spawnattr_setarchpref_np ( &attr, 1, "
"cpu_type = {1:x}, cpu_subtype = {1:x}, count => {2} )",
error, cpu_type, cpu_subtype, ocount);

if (error.Fail() || ocount != 1)
return error;
} else {
error.SetError(
::posix_spawnattr_setbinpref_np(&attr, 1, &cpu_type, &ocount),
eErrorTypePOSIX);
if (error.Fail())
LLDB_LOG(log,
"error: {0}, ::posix_spawnattr_setbinpref_np ( &attr, 1, "
"cpu_type = {1:x}, count => {2} )",
error, cpu_type, ocount);
if (error.Fail() || ocount != 1)
return error;
}
}
}

const char *tmp_argv[2];
char *const *argv = const_cast<char *const *>(
launch_info.GetArguments().GetConstArgumentVector());
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Utility/ArchSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ static const ArchDefinitionEntry g_macho_arch_entries[] = {
{ArchSpec::eCore_arm_armv7m, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_SUBTYPE_ARM_V7M, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_armv7em, llvm::MachO::CPU_TYPE_ARM, llvm::MachO::CPU_SUBTYPE_ARM_V7EM, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64e, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_SUBTYPE_ARM64E, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_SUBTYPE_ARM64_V8, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_SUBTYPE_ARM64_ALL, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, llvm::MachO::CPU_SUBTYPE_ARM64_V8, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64, llvm::MachO::CPU_TYPE_ARM64, 13, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64_32, llvm::MachO::CPU_TYPE_ARM64_32, 0, UINT32_MAX, SUBTYPE_MASK},
{ArchSpec::eCore_arm_arm64_32, llvm::MachO::CPU_TYPE_ARM64_32, 1, UINT32_MAX, SUBTYPE_MASK},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def fp_special_purpose_register_read(self):
self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL)

process = target.GetProcess()
self.assertTrue(process.GetState() == lldb.eStateStopped,
self.assertEqual(process.GetState(), lldb.eStateStopped,
PROCESS_STOPPED)

thread = process.GetThreadAtIndex(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_with_python_api(self):
local_watch.SetCondition(condition)
self.GetWatchpointEvent(lldb.eWatchpointEventTypeConditionChanged)

self.assertTrue(local_watch.GetCondition() == condition,
self.assertEqual(local_watch.GetCondition(), condition,
'make sure watchpoint condition is "' + condition + '"')

def GetWatchpointEvent(self, event_type):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def breakpoint_conditions_python(self):

# We didn't associate a thread index with the breakpoint, so it should
# be invalid.
self.assertTrue(breakpoint.GetThreadIndex() == lldb.UINT32_MAX,
self.assertEqual(breakpoint.GetThreadIndex(), lldb.UINT32_MAX,
"The thread index should be invalid")
# The thread name should be invalid, too.
self.assertTrue(breakpoint.GetThreadName() is None,
Expand All @@ -143,7 +143,7 @@ def breakpoint_conditions_python(self):
# indeed, being set correctly.
# There's only one thread for the process.
breakpoint.SetThreadIndex(1)
self.assertTrue(breakpoint.GetThreadIndex() == 1,
self.assertEqual(breakpoint.GetThreadIndex(), 1,
"The thread index has been set correctly")

# Get the breakpoint location from breakpoint after we verified that,
Expand Down Expand Up @@ -175,7 +175,7 @@ def breakpoint_conditions_python(self):
var.GetValue() == '3')

# The hit count for the breakpoint should be 1.
self.assertTrue(breakpoint.GetHitCount() == 1)
self.assertEqual(breakpoint.GetHitCount(), 1)

# Test that the condition expression didn't create a result variable:
options = lldb.SBExpressionOptions()
Expand Down Expand Up @@ -217,7 +217,7 @@ def breakpoint_invalid_conditions_python(self):
"There should be a thread stopped due to breakpoint condition")
frame0 = thread.GetFrameAtIndex(0)
var = frame0.FindValue('val', lldb.eValueTypeVariableArgument)
self.assertTrue(frame0.GetLineEntry().GetLine() == self.line1)
self.assertEqual(frame0.GetLineEntry().GetLine(), self.line1)

# The hit count for the breakpoint should be 1.
self.assertTrue(breakpoint.GetHitCount() == 1)
self.assertEqual(breakpoint.GetHitCount(), 1)
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def breakpoint_ignore_count_python(self):

# Set the ignore count on the breakpoint location.
location.SetIgnoreCount(2)
self.assertTrue(location.GetIgnoreCount() == 2,
self.assertEqual(location.GetIgnoreCount(), 2,
"SetIgnoreCount() works correctly")

# Now launch the process, and do not stop at entry point.
Expand All @@ -145,6 +145,6 @@ def breakpoint_ignore_count_python(self):
STOPPED_DUE_TO_BREAKPOINT_IGNORE_COUNT)

# The hit count for the breakpoint should be 3.
self.assertTrue(breakpoint.GetHitCount() == 3)
self.assertEqual(breakpoint.GetHitCount(), 3)

process.Continue()
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def test(self):
self.assertTrue(process, PROCESS_IS_VALID)

list = target.FindFunctions('foo', lldb.eFunctionNameTypeAuto)
self.assertTrue(list.GetSize() == 1)
self.assertEqual(list.GetSize(), 1)
sc = list.GetContextAtIndex(0)
self.assertTrue(sc.GetSymbol().GetName() == "foo")
self.assertEqual(sc.GetSymbol().GetName(), "foo")
function = sc.GetFunction()
self.assertTrue(function)
self.function(function, target)
Expand Down Expand Up @@ -75,7 +75,7 @@ def function(self, function, target):

# Breakpoint address should be adjusted to the address of
# branch instruction.
self.assertTrue(branchinstaddress == bpaddr)
self.assertEqual(branchinstaddress, bpaddr)
i += 1
else:
i += 1
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def check_equivalence(self, source_bps, do_write = True):

num_source_bps = source_bps.GetSize()
num_copy_bps = copy_bps.GetSize()
self.assertTrue(num_source_bps == num_copy_bps, "Didn't get same number of input and output breakpoints - orig: %d copy: %d"%(num_source_bps, num_copy_bps))
self.assertEqual(num_source_bps, num_copy_bps, "Didn't get same number of input and output breakpoints - orig: %d copy: %d"%(num_source_bps, num_copy_bps))

for i in range(0, num_source_bps):
source_bp = source_bps.GetBreakpointAtIndex(i)
Expand Down Expand Up @@ -327,12 +327,12 @@ def do_check_names(self):

error = self.copy_target.BreakpointsCreateFromFile(self.bkpts_file_spec, names_list, copy_bps)
self.assertTrue(error.Success(), "Failed reading breakpoints from file: %s"%(error.GetCString()))
self.assertTrue(copy_bps.GetSize() == 0, "Found breakpoints with a nonexistent name.")
self.assertEqual(copy_bps.GetSize(), 0, "Found breakpoints with a nonexistent name.")

names_list.AppendString(good_bkpt_name)
error = self.copy_target.BreakpointsCreateFromFile(self.bkpts_file_spec, names_list, copy_bps)
self.assertTrue(error.Success(), "Failed reading breakpoints from file: %s"%(error.GetCString()))
self.assertTrue(copy_bps.GetSize() == 1, "Found the matching breakpoint.")
self.assertEqual(copy_bps.GetSize(), 1, "Found the matching breakpoint.")

def do_check_extra_args(self):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def do_conditional_break(self):
self.assertTrue(process, PROCESS_IS_VALID)

# The stop reason of the thread should be breakpoint.
self.assertTrue(process.GetState() == lldb.eStateStopped,
self.assertEqual(process.GetState(), lldb.eStateStopped,
STOPPED_DUE_TO_BREAKPOINT)

# Find the line number where a's parent frame function is c.
Expand Down Expand Up @@ -77,12 +77,12 @@ def do_conditional_break(self):
frame1 = thread.GetFrameAtIndex(1)
name1 = frame1.GetFunction().GetName()
# lldbutil.print_stacktrace(thread)
self.assertTrue(name0 == "c", "Break on function c()")
self.assertEqual(name0, "c", "Break on function c()")
if (name1 == "a"):
# By design, we know that a() calls c() only from main.c:27.
# In reality, similar logic can be used to find out the call
# site.
self.assertTrue(frame1.GetLineEntry().GetLine() == line,
self.assertEqual(frame1.GetLineEntry().GetLine(), line,
"Immediate caller a() at main.c:%d" % line)

# And the local variable 'val' should have a value of (int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def test(self):
self.assertEqual(i_atomic.GetNumChildren(), 1)
i = i_atomic.GetChildAtIndex(0)

self.assertTrue(i.GetValueAsUnsigned(0) == 5, "i == 5")
self.assertTrue(s.GetNumChildren() == 2, "s has two children")
self.assertEqual(i.GetValueAsUnsigned(0), 5, "i == 5")
self.assertEqual(s.GetNumChildren(), 2, "s has two children")
self.assertTrue(
s.GetChildAtIndex(0).GetValueAsUnsigned(0) == 1,
"s.x == 1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def cleanup():
"x_val = %s; y_val = %s; z_val = %s; q_val = %s" %
(x_val(), y_val(), z_val(), q_val()))

self.assertFalse(x_val() == 3, "x == 3 before synthetics")
self.assertFalse(y_val() == 4, "y == 4 before synthetics")
self.assertFalse(z_val() == 7, "z == 7 before synthetics")
self.assertFalse(q_val() == 8, "q == 8 before synthetics")
self.assertNotEqual(x_val(), 3, "x == 3 before synthetics")
self.assertNotEqual(y_val(), 4, "y == 4 before synthetics")
self.assertNotEqual(z_val(), 7, "z == 7 before synthetics")
self.assertNotEqual(q_val(), 8, "q == 8 before synthetics")

# now set up the synth
self.runCmd("script from myIntSynthProvider import *")
Expand All @@ -82,10 +82,10 @@ def cleanup():
"x_val = %s; y_val = %s; z_val = %s; q_val = %s" %
(x_val(), y_val(), z_val(), q_val()))

self.assertTrue(x_val() == 3, "x != 3 after synthetics")
self.assertTrue(y_val() == 4, "y != 4 after synthetics")
self.assertTrue(z_val() == 7, "z != 7 after synthetics")
self.assertTrue(q_val() == 8, "q != 8 after synthetics")
self.assertEqual(x_val(), 3, "x != 3 after synthetics")
self.assertEqual(y_val(), 4, "y != 4 after synthetics")
self.assertEqual(z_val(), 7, "z != 7 after synthetics")
self.assertEqual(q_val(), 8, "q != 8 after synthetics")

self.expect("frame variable x", substrs=['3'])
self.expect(
Expand Down
Loading