summaryrefslogtreecommitdiffstats
path: root/test/Frontend
diff options
context:
space:
mode:
Diffstat (limited to 'test/Frontend')
-rw-r--r--test/Frontend/darwin-version.c23
-rw-r--r--test/Frontend/dependency-gen.c7
-rw-r--r--test/Frontend/mmacosx-version-min-test.c1
-rw-r--r--test/Frontend/rewrite-macros.c18
-rw-r--r--test/Frontend/stdin.c3
5 files changed, 52 insertions, 0 deletions
diff --git a/test/Frontend/darwin-version.c b/test/Frontend/darwin-version.c
new file mode 100644
index 0000000..513ea19
--- /dev/null
+++ b/test/Frontend/darwin-version.c
@@ -0,0 +1,23 @@
+// RUN: clang-cc -triple armv6-apple-darwin9 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '10000' | count 1 &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0 &&
+// RUN: clang-cc -triple armv6-apple-darwin9 -miphoneos-version-min=2.0 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20000' | count 1 &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | count 0 &&
+// RUN: clang-cc -triple armv6-apple-darwin9 -miphoneos-version-min=2.2 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20200' | count 1 &&
+// RUN: clang-cc -triple i686-apple-darwin8 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0 &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1 &&
+// RUN: clang-cc -triple i686-apple-darwin9 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1 &&
+// RUN: clang-cc -triple i686-apple-darwin10 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1 &&
+// RUN: clang-cc -triple i686-apple-darwin9 -mmacosx-version-min=10.4 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | count 0 &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1 &&
+// RUN: clang-cc -triple i686-apple-darwin9 -mmacosx-version-min=10.5 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1 &&
+// RUN: clang-cc -triple i686-apple-darwin9 -mmacosx-version-min=10.6 -dM -E -o %t - < /dev/null &&
+// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1 &&
+// RUN: true
diff --git a/test/Frontend/dependency-gen.c b/test/Frontend/dependency-gen.c
new file mode 100644
index 0000000..456ce94
--- /dev/null
+++ b/test/Frontend/dependency-gen.c
@@ -0,0 +1,7 @@
+// rdar://6533411
+// RUN: clang -MD -MF %t.d -c -x c -o %t.o /dev/null &&
+// RUN: grep '.*dependency-gen.c.out.tmp.o:' %t.d &&
+// RUN: grep '/dev/null' %t.d &&
+
+// RUN: clang -M -x c /dev/null -o %t.deps &&
+// RUN: grep 'null.o: /dev/null' %t.deps
diff --git a/test/Frontend/mmacosx-version-min-test.c b/test/Frontend/mmacosx-version-min-test.c
new file mode 100644
index 0000000..d117d1c
--- /dev/null
+++ b/test/Frontend/mmacosx-version-min-test.c
@@ -0,0 +1 @@
+// RUN: not clang-cc -fsyntax-only -mmacosx-version-min=10.4 -triple=x86_64-apple-darwin %s
diff --git a/test/Frontend/rewrite-macros.c b/test/Frontend/rewrite-macros.c
new file mode 100644
index 0000000..32e02ec
--- /dev/null
+++ b/test/Frontend/rewrite-macros.c
@@ -0,0 +1,18 @@
+// RUN: clang-cc -verify --rewrite-macros -o %t %s &&
+
+#define A(a,b) a ## b
+
+// RUN: grep '12 */\*A\*/ /\*(1,2)\*/' %t &&
+A(1,2)
+
+// RUN: grep '/\*_Pragma("mark")\*/' %t &&
+_Pragma("mark")
+
+// RUN: grep "//#warning eek" %t &&
+/* expected-warning {{#warning eek}} */ #warning eek
+
+// RUN: grep "//#pragma mark mark" %t &&
+#pragma mark mark
+
+// RUN: true
+
diff --git a/test/Frontend/stdin.c b/test/Frontend/stdin.c
new file mode 100644
index 0000000..35fe45d
--- /dev/null
+++ b/test/Frontend/stdin.c
@@ -0,0 +1,3 @@
+// RUN: clang-cc -E - < /dev/null > %t
+// RUN: grep '<built-in>' %t
+
OpenPOWER on IntegriCloud