blob: bbbad421cf2a9b500d9b713698c9a05867d81aff [file] [log] [blame]
Eli Friedman14352022008-05-25 04:43:38 +00001// RUN: clang %s -fsyntax-only -verify -pedantic -triple=i686-apple-darwin9
2// This test needs to set the target because it uses __builtin_ia32_vec_ext_v4si
Chris Lattner1b9a0792007-12-20 00:26:33 +00003
4int test1(float a, int b) {
5 return __builtin_isless(a, b);
6}
7int test2(int a, int b) {
8 return __builtin_islessequal(a, b); // expected-error {{floating point type}}
9}
10
11int test3(double a, float b) {
12 return __builtin_isless(a, b);
13}
14int test4(int* a, double b) {
15 return __builtin_islessequal(a, b); // expected-error {{floating point type}}
16}
17
18int test5(float a, long double b) {
19 return __builtin_isless(a, b, b); // expected-error {{too many arguments}}
20}
21int test6(float a, long double b) {
22 return __builtin_islessequal(a); // expected-error {{too few arguments}}
23}
24
25
26#define CFSTR __builtin___CFStringMakeConstantString
27void cfstring() {
28 CFSTR("\242"); // expected-warning {{ CFString literal contains non-ASCII character }}
29 CFSTR("\0"); // expected-warning {{ CFString literal contains NUL character }}
Chris Lattnerb7b61152008-01-04 18:22:42 +000030 CFSTR(242); // expected-error {{ CFString literal is not a string constant }} expected-warning {{incompatible integer to pointer conversion}}
Chris Lattner2c21a072008-11-21 18:44:24 +000031 CFSTR("foo", "bar"); // expected-error {{too many arguments to function call}}
Chris Lattner1b9a0792007-12-20 00:26:33 +000032}
33
Chris Lattner95e2c712008-05-05 22:18:14 +000034
35typedef __attribute__(( ext_vector_type(16) )) unsigned char uchar16; // expected-warning {{extension}}
36
37// rdar://5905347
38unsigned char foo( short v ) {
39 uchar16 c;
40 return __builtin_ia32_vec_ext_v4si( c ); // expected-error {{too few arguments to function}}
41}
42