Chris Lattner | 5cf216b | 2008-01-04 18:04:52 +0000 | [diff] [blame] | 1 | // RUN: clang %s -fsyntax-only -verify -pedantic |
Chris Lattner | 1b9a079 | 2007-12-20 00:26:33 +0000 | [diff] [blame] | 2 | |
| 3 | int test1(float a, int b) { |
| 4 | return __builtin_isless(a, b); |
| 5 | } |
| 6 | int test2(int a, int b) { |
| 7 | return __builtin_islessequal(a, b); // expected-error {{floating point type}} |
| 8 | } |
| 9 | |
| 10 | int test3(double a, float b) { |
| 11 | return __builtin_isless(a, b); |
| 12 | } |
| 13 | int test4(int* a, double b) { |
| 14 | return __builtin_islessequal(a, b); // expected-error {{floating point type}} |
| 15 | } |
| 16 | |
| 17 | int test5(float a, long double b) { |
| 18 | return __builtin_isless(a, b, b); // expected-error {{too many arguments}} |
| 19 | } |
| 20 | int test6(float a, long double b) { |
| 21 | return __builtin_islessequal(a); // expected-error {{too few arguments}} |
| 22 | } |
| 23 | |
| 24 | |
| 25 | #define CFSTR __builtin___CFStringMakeConstantString |
| 26 | void cfstring() { |
| 27 | CFSTR("\242"); // expected-warning {{ CFString literal contains non-ASCII character }} |
| 28 | CFSTR("\0"); // expected-warning {{ CFString literal contains NUL character }} |
Chris Lattner | b7b6115 | 2008-01-04 18:22:42 +0000 | [diff] [blame^] | 29 | CFSTR(242); // expected-error {{ CFString literal is not a string constant }} expected-warning {{incompatible integer to pointer conversion}} |
Chris Lattner | 1b9a079 | 2007-12-20 00:26:33 +0000 | [diff] [blame] | 30 | CFSTR("foo", "bar"); // expected-error {{ error: too many arguments to function }} |
| 31 | } |
| 32 | |