Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libc / test / integration / scudo / gwp_asan_should_crash.cpp
blob4165ccd5b9e6f30ce41d3b592caee93d10fb4faa
1 //===-- libc gwp asan crash test ------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include <stdlib.h>
11 int main() {
12 char retval = 0;
13 for (unsigned i = 0; i < 0x10000; ++i) {
14 char *Ptr = reinterpret_cast<char *>(malloc(10));
16 for (unsigned i = 0; i < 10; ++i) {
17 *(Ptr + i) = 0x0;
20 free(Ptr);
21 volatile char x = *Ptr;
22 retval = retval + x;
24 return retval;