annotate clang/test/Analysis/misc-ps-region-store-i386.m @ 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
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -analyzer-store=region -verify -fblocks %s
anatofuz
parents:
diff changeset
2 // expected-no-diagnostics
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 // Here is a case where a pointer is treated as integer, invalidated as an
anatofuz
parents:
diff changeset
5 // integer, and then used again as a pointer. This test just makes sure
anatofuz
parents:
diff changeset
6 // we don't crash.
anatofuz
parents:
diff changeset
7 typedef unsigned uintptr_t;
anatofuz
parents:
diff changeset
8 void test_pointer_invalidated_as_int_aux(uintptr_t* ptr);
anatofuz
parents:
diff changeset
9 void test_pointer_invalidated_as_int() {
anatofuz
parents:
diff changeset
10 void *x;
anatofuz
parents:
diff changeset
11 test_pointer_invalidated_as_int_aux((uintptr_t*) &x);
anatofuz
parents:
diff changeset
12 // Here we have a pointer to integer cast.
anatofuz
parents:
diff changeset
13 uintptr_t y = (uintptr_t) x;
anatofuz
parents:
diff changeset
14 }
anatofuz
parents:
diff changeset
15