summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/darwin-simulator-macro.c
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2017-03-15 18:04:13 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2017-03-15 18:04:13 +0000
commitf86ded282db098bfc5414ec8ca08e24938328420 (patch)
tree1c1420aec3fe6579c9afa875c26a204bc64edd65 /clang/test/Driver/darwin-simulator-macro.c
parent0e6e0180547046ef182583f6f463692fa160107b (diff)
downloadbcm5719-llvm-f86ded282db098bfc5414ec8ca08e24938328420.tar.gz
bcm5719-llvm-f86ded282db098bfc5414ec8ca08e24938328420.zip
[Driver] Define macro __APPLE_EMBEDDED_SIMULATOR__ when option
-m(i|tv|watch)os-simulator-version-min is on the command line. Previously the driver would treat -m(i|tv|watch)os-simulator-version-min as an alias of -m(i|tv|watch)os-version-min. This no longer works since we now need to distinguish between the two options (the latter is used for iOS running in a VM, for example). This commit stops making the simulator options the aliases of the OS options and defines a macro to differentiate between the two groups of options. rdar://problem/28872911 llvm-svn: 297866
Diffstat (limited to 'clang/test/Driver/darwin-simulator-macro.c')
-rw-r--r--clang/test/Driver/darwin-simulator-macro.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Driver/darwin-simulator-macro.c b/clang/test/Driver/darwin-simulator-macro.c
new file mode 100644
index 00000000000..6971e9303a6
--- /dev/null
+++ b/clang/test/Driver/darwin-simulator-macro.c
@@ -0,0 +1,12 @@
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mios-simulator-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=SIM %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -miphonesimulator-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=SIM %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mtvos-simulator-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=SIM %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mappletvsimulator-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=SIM %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mwatchos-simulator-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=SIM %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mwatchsimulator-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=SIM %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mios-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=DEV %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mtvos-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=DEV %s
+// RUN: %clang -target x86_64-apple-darwin10 -arch x86_64 -mwatchos-version-min=6.0.0 -E -dM %s | FileCheck -check-prefix=DEV %s
+
+// SIM: #define __APPLE_EMBEDDED_SIMULATOR__ 1
+// DEV-NOT: __APPLE_EMBEDDED_SIMULATOR__
OpenPOWER on IntegriCloud