summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/PCH/enum.c15
-rw-r--r--clang/test/PCH/enum.h16
2 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/PCH/enum.c b/clang/test/PCH/enum.c
new file mode 100644
index 00000000000..92869b6bc83
--- /dev/null
+++ b/clang/test/PCH/enum.c
@@ -0,0 +1,15 @@
+// Test this without pch.
+// RUN: clang-cc -triple=i686-apple-darwin9 -include %S/enum.h -fsyntax-only -verify %s
+
+// Test with pch.
+// RUN: clang-cc -emit-pch -triple=i686-apple-darwin9 -o %t %S/enum.h &&
+// RUN: clang-cc -triple=i686-apple-darwin9 -include-pch %t -fsyntax-only -verify %s
+
+int i = Red;
+
+int return_enum_constant() {
+ int result = aRoundShape;
+ return result;
+}
+
+enum Shape s = Triangle;
diff --git a/clang/test/PCH/enum.h b/clang/test/PCH/enum.h
new file mode 100644
index 00000000000..cfa8d6f3d85
--- /dev/null
+++ b/clang/test/PCH/enum.h
@@ -0,0 +1,16 @@
+/* Used in enum.c test */
+
+enum Color {
+ Red,
+ Green,
+ Blue
+};
+
+enum Shape {
+ Square,
+ Triangle,
+ Rhombus,
+ Circle
+};
+
+enum Shape aRoundShape = Circle;
OpenPOWER on IntegriCloud