repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge from mainline.
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
Wstring-literal-comparison-4.c
blob
27f25f3ca98241aefa58f2c2577e44e299e1d895
1
/* PR c/7776 */
2
/* { dg-do compile } */
3
/* { dg-options "-Wall -Wno-string-literal-comparison" } */
4
5
int
test1
(
char
*
ptr
)
6
{
7
return
ptr
==
"foo"
;
8
}
9
10
int
test2
()
11
{
12
return
"foo"
!= (
const char
*)
0
;
13
}
14
15
int
test3
()
16
{
17
return
"foo"
== (
const char
*)
0
;
18
}
19
20
int
test4
()
21
{
22
return
(
const char
*)
0
!=
"foo"
;
23
}
24
25
int
test5
()
26
{
27
return
(
const char
*)
0
==
"foo"
;
28
}
29