summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTareq A. Siraj <tareq.a.sriaj@intel.com>2013-04-16 18:41:26 +0000
committerTareq A. Siraj <tareq.a.sriaj@intel.com>2013-04-16 18:41:26 +0000
commit0de0dd49231a9613339b95c0e1e4a3838eeb6bb3 (patch)
tree4a663f0871760f09966aff9fba5c1e1c3af70256 /clang/test
parentefed27c115f4e0d9f155ea5ae96c5801bda19804 (diff)
downloadbcm5719-llvm-0de0dd49231a9613339b95c0e1e4a3838eeb6bb3.tar.gz
bcm5719-llvm-0de0dd49231a9613339b95c0e1e4a3838eeb6bb3.zip
Parser support for #pragma clang __debug captured
This patch implements parsing ‘#pragma clang __debug’ as a first step for implementing captured statements. Captured statements are a mechanism for doing outlining in the AST. see http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html. Currently returns StmtEmpty Author: Andy Zhang <andy.zhang@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D369 llvm-svn: 179614
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/captured-statements.c14
-rw-r--r--clang/test/Preprocessor/pragma-captured.c13
2 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/Parser/captured-statements.c b/clang/test/Parser/captured-statements.c
new file mode 100644
index 00000000000..30dddb549c9
--- /dev/null
+++ b/clang/test/Parser/captured-statements.c
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -verify %s
+
+void test1()
+{
+ #pragma clang __debug captured x // expected-warning {{extra tokens at end of #pragma clang __debug captured directive}}
+ {
+ }
+}
+
+void test2()
+{
+ #pragma clang __debug captured
+ int x; // expected-error {{expected '{'}}
+}
diff --git a/clang/test/Preprocessor/pragma-captured.c b/clang/test/Preprocessor/pragma-captured.c
new file mode 100644
index 00000000000..be2a62b5e47
--- /dev/null
+++ b/clang/test/Preprocessor/pragma-captured.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -E %s | FileCheck %s
+
+// Test pragma clang __debug captured, for Captured Statements
+
+void test1()
+{
+ #pragma clang __debug captured
+ {
+ }
+// CHECK: void test1()
+// CHECK: {
+// CHECK: #pragma clang __debug captured
+}
OpenPOWER on IntegriCloud