AlexeySachkov added inline comments.

================
Comment at: test/SemaOpenCL/intel-subgroup-avc-ext-types.cl:26
+         char4 c4, event_t e, struct st ss) {
+  intel_sub_group_avc_mce_payload_t payload_mce = 0; // No zero initializer 
for mce types
+  // expected-error@-1 {{initializing 'intel_sub_group_avc_mce_payload_t' with 
an expression of incompatible type 'int'}}
----------------
Anastasia wrote:
> AlexeySachkov wrote:
> > Anastasia wrote:
> > > Would it make sense to add a check for non-zero constant?
> > > 
> > > Also can you assign variables of intel_sub_group_avc_mce_payload_t type 
> > > from the same type? Any other restrictions on assignment (i.e. w integer 
> > > literals) and operations over these types?
> > > Also can you assign variables of intel_sub_group_avc_mce_payload_t type 
> > > from the same type?
> > 
> > Yes, such assignment is allowed.
> > 
> > > Any other restrictions on assignment (i.e. w integer literals)
> > 
> > All of these types can only be initialized using call to a special 
> > built-ins or using predefined macros like 
> > `CLK_AVC_REF_RESULT_INITIALIZE_INTEL`. Any other assignment should lead to 
> > an error. 
> > 
> > I found that I'm able to assign variable of type 
> > `intel_sub_group_avc_imc_payload_t` to variable of type 
> > `intel_sub_group_avc_mce_payload_t`, so I will update the patch when I 
> > implement such diagnostic message.
> > 
> > > and operations over these types?
> > Variables of these types can only be used as return values or arguments for 
> > built-in functions described in the specification. All other operations are 
> > restricted
> W/o the spec change it's really difficult to review properly. So are you 
> testing 2 groups of types:
> 1. Init by zero in `bar`?
> 2. Init by builtin function in `foo`?
> 
I would like to test:
1. foo: init by literal or variable, negative tests
2. far: init by other type or assignment between different types, negative tests
3. bar: init by special initializers from spec, positive tests


================
Comment at: test/SemaOpenCL/intel-subgroup-avc-ext-types.cl:34
+  // expected-error@-1 {{initializing 'intel_sub_group_avc_mce_payload_t' with 
an expression of incompatible type 'int'}}
+  intel_sub_group_avc_ime_payload_t payload_ime = b;
+  // expected-error@-1 {{initializing 'intel_sub_group_avc_ime_payload_t' with 
an expression of incompatible type 'bool'}}
----------------
Anastasia wrote:
> I am not sure it makes sense to iterate through all different types. You 
> don't enumerate all of them and we don't do exhaustive testing in Clang tests 
> anyway. I would just check integer literal and one other builtin type.
Simplified test a little bit.


https://reviews.llvm.org/D51484



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to