Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Add test for __builtin_fminf errors.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: %clang_cc1 %s -pedantic -verify -triple=x86_64-apple-darwin9 | ||
|
||
typedef float float4 __attribute__((ext_vector_type(4))); | ||
|
||
float test_fminf(float f, int i, int *ptr, float4 v) { | ||
float r1 = __builtin_fminf(f, ptr); | ||
// expected-error@-1 {{passing 'int *' to parameter of incompatible type 'float'}} | ||
float r2 = __builtin_fminf(ptr, f); | ||
// expected-error@-1 {{passing 'int *' to parameter of incompatible type 'float'}} | ||
float r3 = __builtin_fminf(v, f); | ||
// expected-error@-1 {{passing 'float4' (vector of 4 'float' values) to parameter of incompatible type 'float'}} | ||
float r4 = __builtin_fminf(f, v); | ||
// expected-error@-1 {{passing 'float4' (vector of 4 'float' values) to parameter of incompatible type 'float'}} | ||
|
||
|
||
int *r5 = __builtin_fminf(f, f); | ||
// expected-error@-1 {{initializing 'int *' with an expression of incompatible type 'float'}} | ||
|
||
int *r6 = __builtin_fminf(f, v); | ||
// expected-error@-1 {{passing 'float4' (vector of 4 'float' values) to parameter of incompatible type 'float'}} | ||
} |