54 lines · plain
1// This test checks that the module cache gets invalidated when the SDKSettings.json file changes.2 3// RUN: rm -rf %t4// RUN: split-file %s %t5 6//--- AppleTVOS15.0.sdk/SDKSettings-old.json7{8 "DisplayName": "tvOS 15.0",9 "Version": "15.0",10 "CanonicalName": "appletvos15.0",11 "MaximumDeploymentTarget": "15.0.99",12 "PropertyConditionFallbackNames": []13}14//--- AppleTVOS15.0.sdk/SDKSettings-new.json15{16 "DisplayName": "tvOS 15.0",17 "Version": "15.0",18 "CanonicalName": "appletvos15.0",19 "MaximumDeploymentTarget": "15.0.99",20 "PropertyConditionFallbackNames": [],21 "VersionMap": {22 "iOS_tvOS": {23 "13.2": "13.1"24 },25 "tvOS_iOS": {26 "13.1": "13.2"27 }28 }29}30//--- module.modulemap31module M { header "M.h" }32//--- M.h33void foo(void) __attribute__((availability(iOS, obsoleted = 13.2)));34void test() { foo(); }35 36//--- tu.m37#include "M.h"38 39// Compiling for tvOS 13.1 without "VersionMap" should succeed, since by default iOS 13.2 gets mapped to tvOS 13.2,40// and \c foo is therefore **not** deprecated.41// RUN: cp %t/AppleTVOS15.0.sdk/SDKSettings-old.json %t/AppleTVOS15.0.sdk/SDKSettings.json42// RUN: %clang -target x86_64-apple-tvos13.1 -isysroot %t/AppleTVOS15.0.sdk \43// RUN: -fsyntax-only %t/tu.m -o %t/tu.o -fmodules -Xclang -fdisable-module-hash -fmodules-cache-path=%t/cache44 45// Compiling for tvOS 13.1 with "VersionMap" saying it maps to iOS 13.2 should fail, since \c foo is now deprecated.46// RUN: sleep 147// RUN: cp %t/AppleTVOS15.0.sdk/SDKSettings-new.json %t/AppleTVOS15.0.sdk/SDKSettings.json48// RUN: not %clang -target x86_64-apple-tvos13.1 -isysroot %t/AppleTVOS15.0.sdk \49// RUN: -fsyntax-only %t/tu.m -o %t/tu.o -fmodules -Xclang -fdisable-module-hash -fmodules-cache-path=%t/cache 2>&1 \50// RUN: | FileCheck %s51// CHECK: M.h:2:15: error: 'foo' is unavailable: obsoleted in tvOS 13.152// CHECK: M.h:1:6: note: 'foo' has been explicitly marked unavailable here53// CHECK: tu.m:1:10: fatal error: could not build module 'M'54