summaryrefslogtreecommitdiff
path: root/test/Lexer/digraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Lexer/digraph.c')
-rw-r--r--test/Lexer/digraph.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/Lexer/digraph.c b/test/Lexer/digraph.c
index e940caf44f4b5..5d8a77d53950c 100644
--- a/test/Lexer/digraph.c
+++ b/test/Lexer/digraph.c
@@ -1,6 +1,13 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding %s
-// expected-no-diagnostics
+// RUN: %clang_cc1 -DDIGRAPHS=1 -fsyntax-only -verify -ffreestanding %s
+// RUN: %clang_cc1 -DDIGRAPHS=1 -fno-digraphs -fdigraphs -fsyntax-only -verify -ffreestanding %s
+// RUN: %clang_cc1 -fno-digraphs -fsyntax-only -verify -ffreestanding %s
+// RUN: %clang_cc1 -fdigraphs -fno-digraphs -fsyntax-only -verify -ffreestanding %s
+// RUN: %clang_cc1 -std=c89 -DDIGRAPHS=1 -fdigraphs -fsyntax-only -verify -ffreestanding %s
+// RUN: %clang_cc1 -std=c89 -fno-digraphs -fsyntax-only -verify -ffreestanding %s
+
+#if DIGRAPHS
+// expected-no-diagnostics
%:include <stdint.h>
%:ifndef BUFSIZE
@@ -14,3 +21,15 @@
d<:len:> = s<:len:>;
%>
%>
+#else
+
+// expected-error@+1 {{expected identifier or '('}}
+%:include <stdint.h>
+;
+// expected-error@+1 {{expected ')'}} expected-note@+1{{to match this '('}}
+void copy(char d<::>);
+
+// expected-error@+1 {{expected function body}}
+void copy() <% %>
+
+#endif