Test subscripting/dereferencing operations on literals #318
Description
This issue was copied from checkedc/checkedc#318
Add runtime tests of subscripting/dereferencing string literals and compound literals. Examples of that are code like "abcdef"[index]
, *("abcdef" + index)
. These are one of the last few cases where we weren't inserting runtime bounds checking required by the Checked C semantics.
This matches the Checked C clang compiler PR checkedc/checkedc-clang#561.
Most of the changes are for adding arguments to test invocations for the new cases.
Fix an error where tests that check dereferencing the result of pointer arithmetic weren't actually checking that. We needed to add -DPOINTER_ARITHMETIC to the command line. We have tests that come two variations: checking subscripting, or checking subscripting expanded into a dereference operation and pointer arithmetic.