Skip to content

Commit d86a947

Browse files
committed
[Sema] Add test for __builtin_fminf errors.
1 parent 9db7e8e commit d86a947

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %clang_cc1 %s -pedantic -verify -triple=x86_64-apple-darwin9
2+
3+
typedef float float4 __attribute__((ext_vector_type(4)));
4+
5+
float test_fminf(float f, int i, int *ptr, float4 v) {
6+
float r1 = __builtin_fminf(f, ptr);
7+
// expected-error@-1 {{passing 'int *' to parameter of incompatible type 'float'}}
8+
float r2 = __builtin_fminf(ptr, f);
9+
// expected-error@-1 {{passing 'int *' to parameter of incompatible type 'float'}}
10+
float r3 = __builtin_fminf(v, f);
11+
// expected-error@-1 {{passing 'float4' (vector of 4 'float' values) to parameter of incompatible type 'float'}}
12+
float r4 = __builtin_fminf(f, v);
13+
// expected-error@-1 {{passing 'float4' (vector of 4 'float' values) to parameter of incompatible type 'float'}}
14+
15+
16+
int *r5 = __builtin_fminf(f, f);
17+
// expected-error@-1 {{initializing 'int *' with an expression of incompatible type 'float'}}
18+
19+
int *r6 = __builtin_fminf(f, v);
20+
// expected-error@-1 {{passing 'float4' (vector of 4 'float' values) to parameter of incompatible type 'float'}}
21+
}

0 commit comments

Comments
 (0)