Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify |
Anders Carlsson | 79cbc7d | 2009-11-14 21:45:58 +0000 | [diff] [blame] | 2 | typedef const struct __CFString * CFStringRef; |
| 3 | #define CFSTR __builtin___CFStringMakeConstantString |
| 4 | |
| 5 | void f() { |
| 6 | (void)CFStringRef(CFSTR("Hello")); |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 7 | } |
Douglas Gregor | 8591098 | 2010-02-12 05:48:04 +0000 | [diff] [blame] | 8 | |
| 9 | void a() { __builtin_va_list x, y; ::__builtin_va_copy(x, y); } |
Eli Friedman | a6c66ce | 2012-08-31 00:14:07 +0000 | [diff] [blame] | 10 | |
| 11 | // <rdar://problem/10063539> |
| 12 | template<int (*Compare)(const char *s1, const char *s2)> |
| 13 | int equal(const char *s1, const char *s2) { |
| 14 | return Compare(s1, s2) == 0; |
| 15 | } |
| 16 | // FIXME: Our error recovery here sucks |
| 17 | template int equal<&__builtin_strcmp>(const char*, const char*); // expected-error {{builtin functions must be directly called}} expected-error {{expected unqualified-id}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
| 18 | |
| 19 | // PR13195 |
| 20 | void f2() { |
| 21 | __builtin_isnan; // expected-error {{builtin functions must be directly called}} |
| 22 | } |