Sign in
gnu
/
gcc
/
cd2fd5facb5e1882d3f338ed456ae9536f7c0593
/
.
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
range-for1.C
blob: 4fecdc71540bde06dbd2aa4e7041a2fd07cbdaa4 [
file
] [
log
] [
blame
]
// Test for range-based for loop
// Test the loop with an array
// { dg-do run { target c++11 } }
extern
"C"
void
abort
();
int
main
()
{
int
a
[]
=
{
1
,
2
,
3
,
4
};
int
sum
=
0
;
for
(
int
x
:
a
)
sum
+=
x
;
if
(
sum
!=
10
)
abort
();
}