Files
clang-p2996/clang/test/CodeGen/functions.c
Aaron Ballman 0f1c1be196 [clang] Remove rdar links; NFC
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
2023-08-28 12:13:42 -04:00

64 lines
1.4 KiB
C

// RUN: %clang_cc1 %s -triple i386-unknown-unknown -Wno-strict-prototypes -emit-llvm -o - -verify | FileCheck %s
int g();
int foo(int i) {
return g(i);
}
int g(int i) {
return g(i);
}
typedef void T(void);
void test3(T f) {
f();
}
void f0(void) {}
// CHECK-LABEL: define{{.*}} void @f0()
void f1();
void f2(void) {
// CHECK: call void @f1()
f1(1, 2, 3);
}
// CHECK-LABEL: define{{.*}} void @f1()
void f1() {}
// CHECK: define {{.*}} @f3{{\(\)|\(.*sret.*\)}}
struct foo { int X, Y, Z; } f3(void) {
while (1) {}
}
// PR4423 - This shouldn't crash in codegen
void f4() {}
void f5(void) { f4(42); } //expected-warning {{too many arguments}}
// Qualifiers on parameter types shouldn't make a difference.
static void f6(const float f, const float g) {
}
void f7(float f, float g) {
f6(f, g);
// CHECK: define{{.*}} void @f7(float{{.*}}, float{{.*}})
// CHECK: call void @f6(float{{.*}}, float{{.*}})
}
// PR6911 - incomplete function types
struct Incomplete;
void f8_callback(struct Incomplete);
void f8_user(void (*callback)(struct Incomplete));
void f8_test(void) {
f8_user(&f8_callback);
// CHECK-LABEL: define{{.*}} void @f8_test()
// CHECK: call void @f8_user(ptr noundef @f8_callback)
// CHECK: declare void @f8_user(ptr noundef)
// CHECK: declare void @f8_callback()
}
// PR10204: don't crash
static void test9_helper(void) {}
void test9(void) {
(void) test9_helper;
}