File: no-implicit-extra-clang-opts.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (30 lines) | stat: -rw-r--r-- 1,824 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
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/ModuleCache)

// https://github.com/apple/swift/issues/70330
// We can't yet call member functions correctly on Windows.
// XFAIL: OS=windows-msvc

import SIMod

// Step 0: Copy relevant files into the temp dir which will serve as the search path
// RUN: cp %S/Inputs/implicit-options-inheritance/module.modulemap %t/module.modulemap
// RUN: cp %S/Inputs/implicit-options-inheritance/test-dummy.modulemap %t/test-dummy.modulemap
// RUN: cp %S/Inputs/implicit-options-inheritance/CIMod.h %t/CIMod.h
// RUN: cp %S/Inputs/implicit-options-inheritance/SIMod.swiftinterface %t/SIMod.swiftinterface

// Step 1: Build this file, causing an implicit build of SIMod and CIMod into the module cache.
// Pass in a clang arg pointing it to a modulemap that has nothing to do with downstream modules and is not on the search path.

// RUN: %target-swift-frontend -emit-module -module-name no-implicit-extra-clang-maps -o %t/no-implicit-extra-clang-maps.swiftmodule %s -I %t -Xcc -fmodule-map-file=%t/test-dummy.modulemap -module-cache-path %t/ModuleCache

// Step 2: Touch the dummy modulemap we passed in with `-Xcc -fmodule-map-file` above.
// RUN: touch %t/test-dummy.modulemap

// Step 3: Re-build this file, and ensure we are not re-building SIMod due to a dependency on the dummy file
// RUN: %target-swift-frontend -emit-module -module-name no-implicit-extra-clang-maps -o %t/no-implicit-extra-clang-maps.swiftmodule %s -I %t -Xcc -fmodule-map-file=%t/test-dummy.modulemap -module-cache-path %t/ModuleCache -Rmodule-interface-rebuild 2>&1 | %FileCheck -allow-empty %s

// Step 4: Ensure that SIMod was not re-built
// CHECK-NOT: remark: rebuilding module 'SIMod' from interface
// CHECK-NOT: note: cached module is out of date
// CHECK-NOT: note: dependency is out of date