Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
3ba8c792
Commit
3ba8c792
authored
12 years ago
by
Jordan Rose
Browse files
Options
Downloads
Patches
Plain Diff
[analyzer] Fix test to work on non-LP64 systems.
Thanks for the original catch in r168303, Takumi. llvm-svn: 168671
parent
8262b885
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clang/test/Analysis/malloc.c
+8
-5
8 additions, 5 deletions
clang/test/Analysis/malloc.c
with
8 additions
and
5 deletions
clang/test/Analysis/malloc.c
+
8
−
5
View file @
3ba8c792
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,debug.ExprInspection -analyzer-store=region -verify %s
// REQUIRES: LP64
#include
"Inputs/system-header-simulator.h"
...
...
@@ -947,20 +946,24 @@ void localStructTest() {
pSt
->
memP
=
malloc
(
12
);
}
// expected-warning{{Memory is never released; potential leak}}
#ifdef __INTPTR_TYPE__
// Test double assignment through integers.
static
long
glob
;
typedef
__INTPTR_TYPE__
intptr_t
;
typedef
unsigned
__INTPTR_TYPE__
uintptr_t
;
static
intptr_t
glob
;
void
test_double_assign_ints
()
{
void
*
ptr
=
malloc
(
16
);
// no-warning
glob
=
(
long
)(
unsigned
long
)
ptr
;
glob
=
(
intptr_t
)(
uintptr_t
)
ptr
;
}
void
test_double_assign_ints_positive
()
{
void
*
ptr
=
malloc
(
16
);
(
void
*
)(
long
)(
unsigned
long
)
ptr
;
// expected-warning {{unused}}
(
void
*
)(
intptr_t
)(
uintptr_t
)
ptr
;
// expected-warning {{unused}}
}
// expected-warning {{leak}}
#endif
void
testCGContextNoLeak
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment