Skip to content

Commit 4f78a95

Browse files
ilcheese2emilio
authored andcommitted
Fix OpenCL vectors that use "ext_vector_type" and add test
1 parent b777e6a commit 4f78a95

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

bindgen-tests/tests/expectations/tests/opencl_vector.rs

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
typedef float float4 __attribute__((ext_vector_type(4)));
2+
typedef float float2 __attribute__((ext_vector_type(2)));
3+
4+
float4 foo(float2 a, float2 b) {
5+
float4 c;
6+
c.xz = a;
7+
c.yw = b;
8+
return c;
9+
}

bindgen/ir/ty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ impl Type {
11171117

11181118
TypeKind::Comp(complex)
11191119
}
1120-
CXType_Vector => {
1120+
CXType_Vector | CXType_ExtVector => {
11211121
let inner = Item::from_ty(
11221122
ty.elem_type().as_ref().unwrap(),
11231123
location,

0 commit comments

Comments
 (0)