NAKAMURA Takumi c193bb7e9e
[Coverage] getMaxBitmapSize: Scan max(BitmapIdx) instead of the last Decision (#78963)
In `CoverageMapping.cpp:getMaxBitmapSize()`, 
this assumed that the last `Decision` has the maxmum `BitmapIdx`.

Let it scan `max(BitmapIdx)`.

Note that `<=` is used insted of `<`, because `BitmapIdx == 0` is valid
and `MaxBitmapID` is `unsigned`. `BitmapIdx` is unique in the record.

Fixes #78922
2024-01-23 17:59:44 +09:00

14 lines
273 B
C

#define RANGE(a,b,c) ((a) <= (b) && (b) <= (c))
int sub(int c) {
if (RANGE('0', c, '9')) return 1;
return (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
}
extern void __llvm_profile_write_file(void);
int main(int c, char **v)
{
return (c > 1 ? sub(c) : 0);
}