diff options
author | Jordan Rupprecht <rupprecht@google.com> | 2019-05-14 21:58:59 +0000 |
---|---|---|
committer | Jordan Rupprecht <rupprecht@google.com> | 2019-05-14 21:58:59 +0000 |
commit | b35a2aa71f76a334a9c98c0a3c3995b5d902d2b9 (patch) | |
tree | cdff4a5d1a715d4ad622fd8f190128b54bebe440 /test/SemaOpenCL/format-strings-fixit.cl | |
parent | 3748d41833787fcbf59cc5624e8d2b042a8991bc (diff) | |
parent | 741e05796da92b46d4f7bcbee00702ff37df6489 (diff) |
Creating branches/google/stable and tags/google/stable/2019-05-14 from r360103upstream/google/stable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/google/stable@360714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL/format-strings-fixit.cl')
-rw-r--r-- | test/SemaOpenCL/format-strings-fixit.cl | 66 |
1 files changed, 59 insertions, 7 deletions
diff --git a/test/SemaOpenCL/format-strings-fixit.cl b/test/SemaOpenCL/format-strings-fixit.cl index b9f949ffe2..533e64d7ca 100644 --- a/test/SemaOpenCL/format-strings-fixit.cl +++ b/test/SemaOpenCL/format-strings-fixit.cl @@ -1,24 +1,76 @@ // RUN: cp %s %t -// RUN: %clang_cc1 -cl-std=CL1.2 -pedantic -Wall -fixit %t -// RUN: %clang_cc1 -cl-std=CL1.2 -fsyntax-only -pedantic -Wall -Werror %t -// RUN: %clang_cc1 -cl-std=CL1.2 -E -o - %t | FileCheck %s +// RUN: %clang_cc1 -cl-std=CL1.2 -pedantic -Wall -fixit %t -triple x86_64-unknown-linux-gnu +// RUN: %clang_cc1 -cl-std=CL1.2 -fsyntax-only -pedantic -Wall -Werror %t -triple x86_64-unknown-linux-gnu +// RUN: %clang_cc1 -cl-std=CL1.2 -E -o - %t -triple x86_64-unknown-linux-gnu | FileCheck %s +#pragma OPENCL EXTENSION cl_khr_fp64 : enable + +typedef __attribute__((ext_vector_type(4))) char char4; +typedef __attribute__((ext_vector_type(4))) short short4; typedef __attribute__((ext_vector_type(4))) int int4; +typedef __attribute__((ext_vector_type(4))) unsigned int uint4; typedef __attribute__((ext_vector_type(8))) int int8; +typedef __attribute__((ext_vector_type(4))) long long4; +typedef __attribute__((ext_vector_type(4))) float float4; +typedef __attribute__((ext_vector_type(4))) double double4; int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2))); void vector_fixits() { printf("%v4f", (int4) 123); - // CHECK: printf("%v4d", (int4) 123); + // CHECK: printf("%v4hld", (int4) 123); printf("%v8d", (int4) 123); - // CHECK: printf("%v4d", (int4) 123); + // CHECK: printf("%v4hld", (int4) 123); printf("%v4d", (int8) 123); - // CHECK: printf("%v8d", (int8) 123); + // CHECK: printf("%v8hld", (int8) 123); printf("%v4f", (int8) 123); - // CHECK: printf("%v8d", (int8) 123); + // CHECK: printf("%v8hld", (int8) 123); + + printf("%v4ld", (int8) 123); + // CHECK: printf("%v8hld", (int8) 123); + + printf("%v4hlf", (int4) 123); + // CHECK: printf("%v4hld", (int4) 123); + + printf("%v8hld", (int4) 123); + // CHECK: printf("%v4hld", (int4) 123); + + printf("%v4hld", (int8) 123); + // CHECK: printf("%v8hld", (int8) 123); + + printf("%v4hlf", (int8) 123); + // CHECK: printf("%v8hld", (int8) 123); + + printf("%v4hd", (int4) 123); + // CHECK: printf("%v4hld", (int4) 123); + + printf("%v4hld", (short4) 123); + // CHECK: printf("%v4hd", (short4) 123); + + printf("%v4ld", (short4) 123); + // CHECK: printf("%v4hd", (short4) 123); + + printf("%v4hld", (long4) 123); + // CHECK: printf("%v4ld", (long4) 123); + + printf("%v8f", (float4) 2.0f); + // CHECK: printf("%v4hlf", (float4) 2.0f); + + printf("%v4f", (float4) 2.0f); + // CHECK: printf("%v4hlf", (float4) 2.0f); + + printf("%v4lf", (double4) 2.0); + // CHECK: printf("%v4lf", (double4) 2.0); + + /// FIXME: This should be fixed + printf("%v4hhd", (int4) 123); + // CHECK: printf("%v4hhd", (int4) 123); + + /// FIXME: This should be fixed + printf("%v4hhd", (int8) 123); + // CHECK: printf("%v4hhd", (int8) 123); } |