File: unit-multiple-sourcefiles-remapped.swift

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (51 lines) | stat: -rw-r--r-- 2,761 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//===--- Building source files separately with a module merge at the end

// RUN: %empty-directory(%t)
// RUN: touch %t/s1.swift %t/s2.swift

// RUN: echo "-----separate-----" > %t/units.out
// RUN: %target-swift-frontend -index-store-path %t/idx1 -file-prefix-map %t=REMAPPED_OUT_DIR -primary-file %t/s1.swift %t/s2.swift -o %t/s1.o -c -module-name main -emit-module -emit-module-path %t/s1.swiftmodule
// RUN: %target-swift-frontend -index-store-path %t/idx1 -file-prefix-map %t=REMAPPED_OUT_DIR %t/s1.swift -primary-file %t/s2.swift -o %t/s2.o -c -module-name main -emit-module -emit-module-path %t/s2.swiftmodule
// RUN: %target-swift-frontend -index-store-path %t/idx1 -file-prefix-map %t=REMAPPED_OUT_DIR %t/s1.swiftmodule %t/s2.swiftmodule -emit-module -o %t/main.swiftmodule -module-name main
// RUN: c-index-test core -print-unit %t/idx1 >> %t/units.out

//===--- Building source files together (e.g. WMO)

// RUN: echo "-----together-----" >> %t/units.out
// RUN: %target-swift-frontend -index-store-path %t/idx2 -file-prefix-map %t=REMAPPED_OUT_DIR %t/s1.swift %t/s2.swift -o %t/s1.o -o %t/s2.o -c -module-name main -emit-module -emit-module-path %t/main.swiftmodule
// RUN: c-index-test core -print-unit %t/idx2 >> %t/units.out

//===--- Building separately but with relative paths for the source file inputs

// RUN: cd %t
// RUN: echo "-----together-relative-----" >> %t/units.out
// RUN: %target-swift-frontend -index-store-path idx3 -file-prefix-map %t=REMAPPED_OUT_DIR -primary-file s1.swift s2.swift -o s1.o -c -module-name main -emit-module -emit-module-path s1.swiftmodule
// RUN: %target-swift-frontend -index-store-path idx3 -file-prefix-map %t=REMAPPED_OUT_DIR s1.swift -primary-file s2.swift -o s2.o -c -module-name main -emit-module -emit-module-path s2.swiftmodule
// RUN: %target-swift-frontend -index-store-path idx3 -file-prefix-map %t=REMAPPED_OUT_DIR s1.swiftmodule s2.swiftmodule -emit-module -o main.swiftmodule -module-name main
// RUN: c-index-test core -print-unit idx3 >> %t/units.out

// RUN: %FileCheck %s --dump-input-filter all < %t/units.out

// CHECK: -----separate-----
// CHECK: s1.o-[[S1_HASH:.*$]]
// CHECK: --------
// CHECK: out-file: REMAPPED_OUT_DIR{{/|\\}}s1.o
// CHECK: s2.o-[[S2_HASH:.*$]]
// CHECK: --------
// CHECK: out-file: REMAPPED_OUT_DIR{{/|\\}}s2.o

// CHECK: -----together-----
// CHECK: s1.o-[[S1_HASH]]
// CHECK: --------
// CHECK: out-file: REMAPPED_OUT_DIR{{/|\\}}s1.o
// CHECK: s2.o-[[S2_HASH]]
// CHECK: --------
// CHECK: out-file: REMAPPED_OUT_DIR{{/|\\}}s2.o

// CHECK: -----together-relative-----
// CHECK: s1.o-[[S1_HASH]]
// CHECK: --------
// CHECK: out-file: REMAPPED_OUT_DIR{{/|\\}}s1.o
// CHECK: s2.o-[[S2_HASH]]
// CHECK: --------
// CHECK: out-file: REMAPPED_OUT_DIR{{/|\\}}s2.o