Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaOpenCL / format-strings-fixit.cl
blob533e64d7ca23f53e0fed6fb725a9ae2d36a5f5a3
1 // RUN: cp %s %t
2 // RUN: %clang_cc1 -cl-std=CL1.2 -pedantic -Wall -fixit %t -triple x86_64-unknown-linux-gnu
3 // RUN: %clang_cc1 -cl-std=CL1.2 -fsyntax-only -pedantic -Wall -Werror %t -triple x86_64-unknown-linux-gnu
4 // RUN: %clang_cc1 -cl-std=CL1.2 -E -o - %t -triple x86_64-unknown-linux-gnu | FileCheck %s
6 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
8 typedef __attribute__((ext_vector_type(4))) char char4;
9 typedef __attribute__((ext_vector_type(4))) short short4;
10 typedef __attribute__((ext_vector_type(4))) int int4;
11 typedef __attribute__((ext_vector_type(4))) unsigned int uint4;
12 typedef __attribute__((ext_vector_type(8))) int int8;
13 typedef __attribute__((ext_vector_type(4))) long long4;
14 typedef __attribute__((ext_vector_type(4))) float float4;
15 typedef __attribute__((ext_vector_type(4))) double double4;
17 int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)));
20 void vector_fixits() {
21 printf("%v4f", (int4) 123);
22 // CHECK: printf("%v4hld", (int4) 123);
24 printf("%v8d", (int4) 123);
25 // CHECK: printf("%v4hld", (int4) 123);
27 printf("%v4d", (int8) 123);
28 // CHECK: printf("%v8hld", (int8) 123);
30 printf("%v4f", (int8) 123);
31 // CHECK: printf("%v8hld", (int8) 123);
33 printf("%v4ld", (int8) 123);
34 // CHECK: printf("%v8hld", (int8) 123);
36 printf("%v4hlf", (int4) 123);
37 // CHECK: printf("%v4hld", (int4) 123);
39 printf("%v8hld", (int4) 123);
40 // CHECK: printf("%v4hld", (int4) 123);
42 printf("%v4hld", (int8) 123);
43 // CHECK: printf("%v8hld", (int8) 123);
45 printf("%v4hlf", (int8) 123);
46 // CHECK: printf("%v8hld", (int8) 123);
48 printf("%v4hd", (int4) 123);
49 // CHECK: printf("%v4hld", (int4) 123);
51 printf("%v4hld", (short4) 123);
52 // CHECK: printf("%v4hd", (short4) 123);
54 printf("%v4ld", (short4) 123);
55 // CHECK: printf("%v4hd", (short4) 123);
57 printf("%v4hld", (long4) 123);
58 // CHECK: printf("%v4ld", (long4) 123);
60 printf("%v8f", (float4) 2.0f);
61 // CHECK: printf("%v4hlf", (float4) 2.0f);
63 printf("%v4f", (float4) 2.0f);
64 // CHECK: printf("%v4hlf", (float4) 2.0f);
66 printf("%v4lf", (double4) 2.0);
67 // CHECK: printf("%v4lf", (double4) 2.0);
69 /// FIXME: This should be fixed
70 printf("%v4hhd", (int4) 123);
71 // CHECK: printf("%v4hhd", (int4) 123);
73 /// FIXME: This should be fixed
74 printf("%v4hhd", (int8) 123);
75 // CHECK: printf("%v4hhd", (int8) 123);