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