Matt Arsenault | e19dc61 | 2018-11-13 22:30:35 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -cl-std=CL1.2 -fsyntax-only -verify %s |
| 2 | |
| 3 | typedef __attribute__((ext_vector_type(2))) float float2; |
| 4 | typedef __attribute__((ext_vector_type(4))) float float4; |
| 5 | typedef __attribute__((ext_vector_type(4))) int int4; |
| 6 | |
| 7 | int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2))); |
| 8 | |
| 9 | kernel void format_v4f32(float4 arg) |
| 10 | { |
| 11 | printf("%v4f\n", arg); // expected-no-diagnostics |
| 12 | } |
| 13 | |
| 14 | kernel void format_v4f32_wrong_num_elts(float2 arg) |
| 15 | { |
| 16 | printf("%v4f\n", arg); // expected-no-diagnostics |
| 17 | } |
| 18 | |
| 19 | kernel void vector_precision_modifier_v4f32(float4 arg) |
| 20 | { |
| 21 | printf("%.2v4f\n", arg); // expected-no-diagnostics |
| 22 | } |
| 23 | |
| 24 | // FIXME: This should warn |
| 25 | kernel void format_missing_num_elts(float4 arg) |
| 26 | { |
| 27 | printf("%vf\n", arg); // expected-no-diagnostics |
| 28 | } |
| 29 | |
| 30 | // FIXME: This should warn |
| 31 | kernel void vector_precision_modifier_v4i32(int4 arg) |
| 32 | { |
| 33 | printf("%.2v4f\n", arg); // expected-no-diagnostics |
| 34 | } |