brintos

brintos / llvm-project-archived public Read only

0
0
Text · 822 B · d68ee5f Raw
34 lines · cpp
1//===----------------------------------------------------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9// <map>10 11// class map12 13// mapped_type& at(const key_type& k);14 15// Make sure we abort() when exceptions are disabled and we fetch a key that16// is not in the map.17 18// REQUIRES: no-exceptions19 20#include <csignal>21#include <cstdlib>22#include <map>23 24#include "test_macros.h"25 26void exit_success(int) { std::_Exit(EXIT_SUCCESS); }27 28int main(int, char**) {29  std::signal(SIGABRT, exit_success);30  std::map<int, int> map;31  map.at(1);32  return EXIT_FAILURE;33}34