27 lines · c
1// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-macos -DMAC -verify %s2// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-ios -verify %s3// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-tvos -verify %s4// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-watchos -verify %s5// expected-no-diagnostics6 7#if !__is_target_os(darwin)8 #error "mismatching os"9#endif10 11// macOS matches both macOS and macOSX.12#ifdef MAC13 14#if !__is_target_os(macos)15 #error "mismatching os"16#endif17 18#if !__is_target_os(macosx)19 #error "mismatching os"20#endif21 22#if __is_target_os(ios)23 #error "mismatching os"24#endif25 26#endif27