[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / associative / map / PR28469_undefined_behavior_segfault.sh.cpp
blob584b829e36aa186042578d30ca122e01e7ebf5e1
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // RUN: %{build} -O2
12 // RUN: %{run}
14 // <map>
16 // Previously this code caused a segfault when compiled at -O2 due to undefined
17 // behavior in __tree. See https://llvm.org/PR28469
19 #include <functional>
20 #include <map>
22 void dummy() {}
24 struct F {
25 std::map<int, std::function<void()> > m;
26 F() { m[42] = &dummy; }
29 int main(int, char**) {
30 F f;
31 f = F();
33 return 0;