annotate clang/test/CodeGenCXX/wasm-sanitize-vptr.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -std=c++11 -fsanitize=vptr -emit-llvm %s -o - -triple wasm32-unknown-emscripten | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 struct S {
anatofuz
parents:
diff changeset
4 virtual ~S() {}
anatofuz
parents:
diff changeset
5 int a;
anatofuz
parents:
diff changeset
6 };
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 struct T : S {
anatofuz
parents:
diff changeset
9 int b;
anatofuz
parents:
diff changeset
10 };
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 // CHECK-LABEL: @_Z15bad_static_castv
anatofuz
parents:
diff changeset
13 void bad_static_cast() {
anatofuz
parents:
diff changeset
14 S s;
anatofuz
parents:
diff changeset
15 // CHECK: br i1 %[[NONNULL:.*]], label %[[CONT:.*]], label %[[MISS:.*]], !prof
anatofuz
parents:
diff changeset
16 // CHECK: [[MISS]]:
anatofuz
parents:
diff changeset
17 // CHECK: call void @__ubsan_handle_dynamic_type_cache_miss_abort
anatofuz
parents:
diff changeset
18 // CHECK: [[CONT]]:
anatofuz
parents:
diff changeset
19 T &r = static_cast<T &>(s);
anatofuz
parents:
diff changeset
20 }