repo.or.cz
/
llvm
/
zpu.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fixed some bugs.
[llvm/zpu.git]
/
test
/
FrontendC
/
2007-10-01-BuildArrayRef.c
blob
e87a5b6305403fc04f79e38b86e248df1c601c59
1
// RUN: not %llvmgcc_only -c %s -o /dev/null |& FileCheck %s
2
// PR 1603
3
void
func
()
4
{
5
const int
*
arr
;
6
arr
[
0
] =
1
;
// CHECK: error: assignment of read-only location
7
}
8
9
struct
foo
{
10
int
bar
;
11
};
12
struct
foo sfoo
= {
0
};
13
14
int
func2
()
15
{
16
const struct
foo
*
fp
;
17
fp
= &
sfoo
;
18
fp
[
0
].
bar
=
1
;
// CHECK: error: assignment of read-only member 'bar'
19
return
sfoo
.
bar
;
20
}