// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-linux-gnu -emit-llvm -fstrict-vtable-pointers -o - %s \
// RUN: | FileCheck --check-prefixes=CHECK,CHECK-STRICT %s
// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-linux-gnu -emit-llvm -o - %s \
// RUN: | FileCheck --check-prefixes=CHECK,CHECK-NONSTRICT %s
//===----------------------------------------------------------------------===//
// Positive Cases
//===----------------------------------------------------------------------===//
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_virtual_fn
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_poly_base
extern "C" void
;
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_virtual_base
extern "C" void
//===----------------------------------------------------------------------===//
// Negative Cases
//===----------------------------------------------------------------------===//
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_ommitted_one
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_ommitted_two
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_virtual_member
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_virtual_member_depth_2
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_virtual_reference_member
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_recursive_member
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_virtual_recursive_member
extern "C" void
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_array(
extern "C" void
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_array_nested(
extern "C" void
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_array_no_invariant(
extern "C" void
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_array_nested_no_invariant(
extern "C" void
;
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_member_array(
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_member_array_nested(
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_member_array_no_invariant(
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_member_array_nested_no_invariant(
extern "C" void
;
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_base_no_invariant(
extern "C" void
;
// CHECK-LABEL: define{{.*}} void @test_builtin_launder_base(
extern "C" void
/// The test cases in this namespace technically need to be laundered according
/// to the language in the standard (ie they have const or reference subobjects)
/// but LLVM doesn't currently optimize on these cases -- so Clang emits
/// __builtin_launder as a nop.
///
/// NOTE: Adding optimizations for these cases later is an LTO ABI break. That's
/// probably OK for now -- but is something to keep in mind.
// namespace pessimizing_cases