annotate clang/test/Analysis/svalbuilder-logic.c @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900 (2021-07-18)
parents 0572611fdcc8
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -Wno-pointer-to-int-cast -verify %s
150
anatofuz
parents:
diff changeset
2 // expected-no-diagnostics
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // Testing core functionality of the SValBuilder.
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 int SValBuilderLogicNoCrash(int *x) {
anatofuz
parents:
diff changeset
7 return 3 - (int)(x +3);
anatofuz
parents:
diff changeset
8 }
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 // http://llvm.org/bugs/show_bug.cgi?id=15863
anatofuz
parents:
diff changeset
11 // Don't crash when mixing 'bool' and 'int' in implicit comparisons to 0.
anatofuz
parents:
diff changeset
12 void pr15863() {
anatofuz
parents:
diff changeset
13 extern int getBool();
anatofuz
parents:
diff changeset
14 _Bool a = getBool();
anatofuz
parents:
diff changeset
15 (void)!a; // no-warning
anatofuz
parents:
diff changeset
16 }