37 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// <locale>10 11// class locale;12 13// locale(const locale& other, const char* std_name, category cat);14 15// REQUIRES: no-exceptions16 17// Make sure we abort() when we construct a locale with a null name and18// exceptions are disabled.19 20#include <csignal>21#include <cstdlib>22#include <locale>23 24#include "test_macros.h"25 26 27void exit_success(int) {28 std::_Exit(EXIT_SUCCESS);29}30 31int main(int, char**) {32 std::signal(SIGABRT, exit_success);33 std::locale loc(std::locale(), NULL, std::locale::ctype);34 (void)loc;35 return EXIT_FAILURE;36}37