Skip to content

Commit c440477

Browse files
[NFC] [ModuleTrace] Add negative test case for cycles in trace emission (ep2).
Context: rdar://67704000.
1 parent 828ab6d commit c440477

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

test/Driver/Inputs/imported_modules/ComplexModuleGraph2/DaemonKit.h renamed to test/Driver/Inputs/imported_modules/ComplexModuleGraph2/DaemonKit/DaemonKit.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#import <DaemonKit/ViolateSecondLawOfThermodynamics.h>
2+
13
#import <CoreDaemon.h>
24

35
struct DaemonPair {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#import <CoreDaemon.h>
2+
3+
struct MaxwellsDaemon {
4+
Runner *doorOperation;
5+
};

test/Driver/Inputs/imported_modules/ComplexModuleGraph2/module.modulemap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ module CoreDaemon {
1414
}
1515

1616
module DaemonKit {
17-
header "DaemonKit.h"
17+
umbrella header "DaemonKit/DaemonKit.h"
18+
explicit module ViolateSecondLawOfThermodynamics {
19+
header "DaemonKit/ViolateSecondLawOfThermodynamics.h"
20+
export *
21+
}
1822
export *
1923
}
2024

test/Driver/loaded_module_trace_directness_2.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,24 @@ public func runBoth(_ pair: DaemonKit.DaemonPair) {
9999
// RUN: %target-swift-frontend %s -typecheck -DTestDaemon -DV1 -module-name TestDaemonV1 -emit-loaded-module-trace-path %t/TestDaemonV1.trace.json -I %t/include
100100
// RUN: %FileCheck %s --check-prefix=TESTDAEMON < %t/TestDaemonV1.trace.json
101101

102-
// RUN: %target-swift-frontend %s -typecheck -DTestDaemon -DV2 -module-name TestDaemonV2 -emit-loaded-module-trace-path %t/TestDaemonV2.trace.json -I %t/include
103-
// RUN: %FileCheck %s --check-prefix=TESTDAEMON < %t/TestDaemonV2.trace.json
102+
// FIXME: rdar://67704000
103+
// RUN: not --crash %target-swift-frontend %s -typecheck -DTestDaemon -DV2 -module-name TestDaemonV2 -emit-loaded-module-trace-path %t/TestDaemonV2.trace.json -I %t/include
104+
// SKIP: %FileCheck %s --check-prefix=TESTDAEMON < %t/TestDaemonV2.trace.json
104105

105106
// RUN: %target-swift-frontend %s -typecheck -DTestDaemon -DV3 -module-name TestDaemonV3 -emit-loaded-module-trace-path %t/TestDaemonV3.trace.json -I %t/include
106107
// RUN: %FileCheck %s --check-prefix=TESTDAEMON < %t/TestDaemonV3.trace.json
107108

108-
// RUN: %target-swift-frontend %s -typecheck -DTestDaemon -DV4 -module-name TestDaemonV4 -emit-loaded-module-trace-path %t/TestDaemonV4.trace.json -I %t/include
109-
// RUN: %FileCheck %s --check-prefix=TESTDAEMON < %t/TestDaemonV4.trace.json
109+
// FIXME: rdar://67704000
110+
// RUN: not --crash %target-swift-frontend %s -typecheck -DTestDaemon -DV4 -module-name TestDaemonV4 -emit-loaded-module-trace-path %t/TestDaemonV4.trace.json -I %t/include
111+
// SKIP: %FileCheck %s --check-prefix=TESTDAEMON < %t/TestDaemonV4.trace.json
110112

111113
#if TestDaemon
112114
#if V1
113115
import CoreDaemon
114116
#endif
115117
#if V2
116118
import DaemonKit
117-
public func noop(_: CoreDaemon.Daemon) {}
119+
public func noop(_: CoreDaemon.Daemon, _: MaxwellsDaemon) {}
118120
#endif
119121
#if V3
120122
import CoreDaemon

0 commit comments

Comments
 (0)