brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · e8c7a40 Raw
66 lines · c
1// RUN: %clang_analyze_cc1 -ffixed-point \2// RUN:   -analyzer-checker=core,debug.ExprInspection -verify %s3 4// expected-no-diagnostics5 6// Check that getAPSIntType does not crash7// when using fixed point types.8 9enum Kind { en_0 = 1 };10 11void _enum(int c) {12  (void)((enum Kind) c >> 4);13}14 15void _inttype(int c) {16  (void)(c >> 4);17}18 19void _accum(int c) {20  (void)((_Accum) c >> 4);21}22 23void _fract(int c) {24  (void)((_Fract) c >> 4);25}26 27void _long_fract(int c) {28  (void)((long _Fract) c >> 4);29}30 31void _unsigned_accum(int c) {32  (void)((unsigned _Accum) c >> 4);33}34 35void _short_unsigned_accum(int c) {36  (void)((short unsigned _Accum) c >> 4);37}38 39void _unsigned_fract(int c) {40  (void)((unsigned _Fract) c >> 4);41}42 43void sat_accum(int c) {44  (void)((_Sat _Accum) c >> 4);45}46 47void sat_fract(int c) {48  (void)((_Sat _Fract) c >> 4);49}50 51void sat_long_fract(int c) {52  (void)((_Sat long _Fract) c >> 4);53}54 55void sat_unsigned_accum(int c) {56  (void)((_Sat unsigned _Accum) c >> 4);57}58 59void sat_short_unsigned_accum(int c) {60  (void)((_Sat short unsigned _Accum) c >> 4);61}62 63void sat_unsigned_fract(int c) {64  (void)((_Sat unsigned _Fract) c >> 4);65}66