C99 testsuite readiness: Compile more tests with -std=gnu89
[official-gcc.git] / gcc / testsuite / g++.dg / pr99966.C
blob4d689822b87a26c28bb580885797d5963b207c81
1 // { dg-do compile }
2 // { dg-require-effective-target c++17 }
3 // { dg-options "-O2 -fdump-tree-vrp1" }
5 // Test we can remove a range bound after the assert.
7 #include <cassert>
8 #include <cstdint>
9 #include <cstddef>
10 #include <vector>
12 uint64_t f(std::vector<uint64_t>& data, size_t start, size_t end){
13     assert(start < end && start < data.size() && end <= data.size());
16     uint64_t total = 0;
17     for (size_t i = start; i < end; i++) {
18         total += data.at(i);
19     }
20     return total;
23 /* { dg-final { scan-tree-dump-not "throw" "vrp1"} } */