mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 02:16:06 +00:00

We have a new policy in place making links to private resources something we try to avoid in source and test files. Normally, we'd organically switch to the new policy rather than make a sweeping change across a project. However, Clang is in a somewhat special circumstance currently: recently, I've had several new contributors run into rdar links around test code which their patch was changing the behavior of. This turns out to be a surprisingly bad experience, especially for newer folks, for a handful of reasons: not understanding what the link is and feeling intimidated by it, wondering whether their changes are actually breaking something important to a downstream in some way, having to hunt down strangers not involved with the patch to impose on them for help, accidental pressure from asking for potentially private IP to be made public, etc. Because folks run into these links entirely by chance (through fixing bugs or working on new features), there's not really a set of problematic links to focus on -- all of the links have basically the same potential for causing these problems. As a result, this is an omnibus patch to remove all such links. This was not a mechanical change; it was done by manually searching for rdar, radar, radr, and other variants to find all the various problematic links. From there, I tried to retain or reword the surrounding comments so that we would lose as little context as possible. However, because most links were just a plain link with no supporting context, the majority of the changes are simple removals. Differential Review: https://reviews.llvm.org/D158071
51 lines
1.7 KiB
C++
51 lines
1.7 KiB
C++
// RUN: %clang_cc1 %s -triple=armv7-apple-darwin10 -emit-llvm -o - -fexceptions -fcxx-exceptions | FileCheck %s
|
|
|
|
// Check that we annotate all compiler-synthesized runtime calls and
|
|
// functions with the actual ABI-determined CC. This usually doesn't
|
|
// matter as long as we're internally consistent (and the LLVM-default
|
|
// CC is consistent with the real one), but it's possible for user
|
|
// translation units to define these runtime functions (or, equivalently,
|
|
// for us to get LTO'ed with such a translation unit), and then the
|
|
// mismatch will kill us.
|
|
|
|
// CHECK: [[A:%.*]] = type { double }
|
|
|
|
namespace test0 {
|
|
struct A {
|
|
double d;
|
|
A();
|
|
~A();
|
|
};
|
|
|
|
A global;
|
|
// CHECK-LABEL: define internal void @__cxx_global_var_init()
|
|
// CHECK: call noundef ptr @_ZN5test01AC1Ev(ptr {{[^,]*}} @_ZN5test06globalE)
|
|
// CHECK-NEXT: call i32 @__cxa_atexit(ptr @_ZN5test01AD1Ev, ptr @_ZN5test06globalE, ptr @__dso_handle) [[NOUNWIND:#[0-9]+]]
|
|
// CHECK-NEXT: ret void
|
|
}
|
|
|
|
// CHECK: declare i32 @__cxa_atexit(ptr, ptr, ptr) [[NOUNWIND]]
|
|
|
|
namespace test1 {
|
|
void test() {
|
|
throw 0;
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} void @_ZN5test14testEv()
|
|
// CHECK: [[T0:%.*]] = call ptr @__cxa_allocate_exception(i32 4) [[NOUNWIND]]
|
|
// CHECK-NEXT: store i32 0, ptr [[T0]]
|
|
// CHECK-NEXT: call void @__cxa_throw(ptr [[T0]], ptr @_ZTIi, ptr null) [[NORETURN:#[0-9]+]]
|
|
// CHECK-NEXT: unreachable
|
|
}
|
|
|
|
// CHECK: declare ptr @__cxa_allocate_exception(i32)
|
|
|
|
// CHECK: declare void @__cxa_throw(ptr, ptr, ptr)
|
|
|
|
// CHECK-LABEL: define internal void @_GLOBAL__sub_I_runtimecc.cpp()
|
|
// CHECK: call void @__cxx_global_var_init()
|
|
|
|
|
|
// CHECK: attributes [[NOUNWIND]] = { nounwind }
|
|
// CHECK: attributes [[NORETURN]] = { noreturn }
|