Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OPENCL] Fix wrongly vla error for OpenCL array.
Summary: OpenCL should support array with const value size length, those const varibale in global and constant address space and variable in constant address space. Reviewers: Anastasia, yaxunl, bader Subscribers: bader, cfe-commits Differential Revision: http://reviews.llvm.org/D20090 llvm-svn: 271971
- Loading branch information
Showing
3 changed files
with
24 additions
and
2 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
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
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,18 @@ | ||
// RUN: %clang_cc1 -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s | ||
|
||
constant int sz0 = 5; | ||
// CHECK: @sz0 = constant i32 5, align 4 | ||
const global int sz1 = 16; | ||
// CHECK: @sz1 = constant i32 16, align 4 | ||
const constant int sz2 = 8; | ||
// CHECK: @sz2 = constant i32 8, align 4 | ||
// CHECK: @testvla.vla2 = internal global [8 x i16] undef, align 16 | ||
|
||
kernel void testvla() | ||
{ | ||
int vla0[sz0]; | ||
// CHECK: %vla0 = alloca [5 x i32], align 16 | ||
char vla1[sz1]; | ||
// CHECK: %vla1 = alloca [16 x i8], align 16 | ||
local short vla2[sz2]; | ||
} |