vasu-the-sharma wrote:

> > > // CHECK: call void @__ubsan_handle_type_mismatch_v1_abort
> > > // CHECK: call void @llvm.memcpy
> > 
> > 
> > Update these to check for the labels (with the calls being on the next 
> > line). Note that this does not cover the array bounds checking.
> 
> Considering that we are testing different operand/operation forms on purpose 
> (because of varying compiler code paths), I think we should (to reduce test 
> complexity) limit the explicit checking for the IR condition checks to single 
> "exemplar" cases (e.g., one each of non-array LHS and RHS, one each of array 
> LHS and RHS). For the other non-array-bounds checks, we could check just for 
> the handler call. We need to check the IR condition check for the array 
> bounds though (to accurately identify that one-past-the-end is considered not 
> okay to access).

Done. The updated structure of the testcase is:

Exemplar cases (IR with CHECK-NEXT):
```
test_lhs_ptr - non-array LHS (C only)
test_lhs_array - array LHS (C only)
test_rhs_ptr - non-array RHS
test_rhs_array - array RHS
```

Simple cases (handler call only):
```
test_init_from_ptr, test_init_from_array
C++ forms: test_cxx_direct_init, test_cxx_brace_init, test_cxx_new
```

Array bounds (condition check):
`test_oob_rhs - checks br i1 and handler.out_of_bounds:`

I have also added `union` type under `macro` control with extra `RUN` line.

https://github.com/llvm/llvm-project/pull/190739
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to