Skip to content

Commit

Permalink
Add tests for driver to propagate module map flags for layering check (
Browse files Browse the repository at this point in the history
…#75827)

Xcode 14.3.1 seems to have dropped these flags so we are creating unit tests to reproduce the issue.
  • Loading branch information
googlewalt committed Dec 21, 2023
1 parent 192f720 commit 6a870cc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion clang/test/Driver/modules.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,21 @@
// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=foo.map"
// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=bar.map"

// RUN: %clang -fmodules -fbuiltin-module-map -### %s 2>&1 | FileCheck -check-prefix=CHECK-BUILTIN-MODULE-MAP %s
// Verify that the driver propagates -fmodule-name and -fmodule-map-file flags when
// -fmodules-decluse or -fmodules-strict-decluse, as used for layering check.
// RUN: %clang -fmodules-decluse -fmodule-name=foo -c -### %s 2>&1 | FileCheck -check-prefix=CHECK-DECLUSE-PROPAGATE-MODULE-NAME %s
// CHECK-DECLUSE-PROPAGATE-MODULE-NAME: -fmodule-name=foo

// RUN: %clang -fmodules-decluse -fmodule-map-file=foo.map -c -### %s 2>&1 | FileCheck -check-prefix=CHECK-DECLUSE-PROPAGATE-MODULE-MAPS %s
// CHECK-DECLUSE-PROPAGATE-MODULE-MAPS: -fmodule-map-file=foo.map

// RUN: %clang -fmodules-strict-decluse -fmodule-name=foo -c -### %s 2>&1 | FileCheck -check-prefix=CHECK-STRICT-DECLUSE-PROPAGATE-MODULE-NAME %s
// CHECK-STRICT-DECLUSE-PROPAGATE-MODULE-NAME: -fmodule-name=foo

// RUN: %clang -fmodules-strict-decluse -fmodule-map-file=foo.map -c -### %s 2>&1 | FileCheck -check-prefix=CHECK-STRICT-DECLUSE-PROPAGATE-MODULE-MAPS %s
// CHECK-STRICT-DECLUSE-PROPAGATE-MODULE-MAPS: -fmodule-map-file=foo.map

// RUN: %clang -fmodules -fbuiltin-module-map -### %s 2>&1 | FileCheck -check-prefix=CHECK-BUILTIN-MODULE-MAP %s
// CHECK-BUILTIN-MODULE-MAP: "-fmodules"
// CHECK-BUILTIN-MODULE-MAP: "-fmodule-map-file={{.*}}include{{/|\\\\}}module.modulemap"

Expand Down

0 comments on commit 6a870cc

Please sign in to comment.