blob: 7ee84539bf3aa1236268317ea3220722ec2cd88a [file] [log] [blame]
Graydon Hoare4d867642016-12-21 00:24:39 +00001// RUN: rm -rf %t
2
3// Build PCH using A, with adjacent private module APrivate, which winds up being implicitly referenced
Bruno Cardoso Lopes297299192017-12-22 02:53:30 +00004// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-different-name -emit-pch -o %t-A.pch %s -Wprivate-module
Graydon Hoare4d867642016-12-21 00:24:39 +00005
Graydon Hoaredc0405f2017-01-18 20:34:44 +00006// Use the PCH with no explicit way to resolve APrivate, still pick it up by automatic second-chance search for "A" with "Private" appended
Bruno Cardoso Lopes297299192017-12-22 02:53:30 +00007// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-different-name -include-pch %t-A.pch %s -fsyntax-only -Wprivate-module
Graydon Hoare4d867642016-12-21 00:24:39 +00008
9// Check the fixit
Bruno Cardoso Lopes297299192017-12-22 02:53:30 +000010// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-different-name -include-pch %t-A.pch %s -fsyntax-only -fdiagnostics-parseable-fixits -Wprivate-module %s 2>&1 | FileCheck %s
Graydon Hoare4d867642016-12-21 00:24:39 +000011
Bruno Cardoso Lopes297299192017-12-22 02:53:30 +000012// expected-warning@Inputs/implicit-private-with-different-name/A.framework/Modules/module.private.modulemap:1{{expected canonical name for private module 'APrivate'}}
13// expected-note@Inputs/implicit-private-with-different-name/A.framework/Modules/module.private.modulemap:1{{rename 'APrivate' to ensure it can be found by name}}
14// CHECK: fix-it:"{{.*}}module.private.modulemap":{1:18-1:26}:"A_Private"
Graydon Hoare4d867642016-12-21 00:24:39 +000015
16#ifndef HEADER
17#define HEADER
18#import "A/aprivate.h"
19const int *y = &APRIVATE;
20#endif