You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.0 KiB

// 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
%:define BUFSIZE 512
%:endif
void copy(char d<::>, const char s<::>, int len)
<%
while (len-- >= 0)
<%
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