[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / Analysis / conversion-tracking-notes.c
blobd9db5e99200b6155c5a74d20699859d2b006e40c
1 // RUN: %clang_analyze_cc1 %s \
2 // RUN: -Wno-conversion -Wno-tautological-constant-compare \
3 // RUN: -analyzer-checker=core,apiModeling,alpha.core.Conversion \
4 // RUN: -analyzer-output=text \
5 // RUN: -verify
7 unsigned char U8;
8 signed char S8;
10 void track_assign(void) {
11 unsigned long L = 1000; // expected-note {{'L' initialized to 1000}}
12 int I = -1; // expected-note {{'I' initialized to -1}}
13 U8 *= L; // expected-warning {{Loss of precision in implicit conversion}}
14 // expected-note@-1 {{Loss of precision in implicit conversion}}
15 L *= I; // expected-warning {{Loss of sign in implicit conversion}}
16 // expected-note@-1 {{Loss of sign in implicit conversion}}
19 void track_relational(unsigned U, signed S) {
20 if (S < -10) { // expected-note {{Taking true branch}}
21 // expected-note@-1 {{Assuming the condition is true}}
22 if (U < S) { // expected-warning {{Loss of sign in implicit conversion}}
23 // expected-note@-1 {{Loss of sign in implicit conversion}}