
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
59 lines
2.0 KiB
C
59 lines
2.0 KiB
C
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify %s
|
|
|
|
void qualifiers(void) {
|
|
asm("");
|
|
asm volatile("");
|
|
asm inline("");
|
|
asm goto("" ::::foo);
|
|
foo:;
|
|
}
|
|
|
|
void unknown_qualifiers(void) {
|
|
asm noodle(""); // expected-error {{expected 'volatile', 'inline', 'goto', or '('}}
|
|
asm goto noodle("" ::::foo); // expected-error {{expected 'volatile', 'inline', 'goto', or '('}}
|
|
asm volatile noodle inline(""); // expected-error {{expected 'volatile', 'inline', 'goto', or '('}}
|
|
foo:;
|
|
}
|
|
|
|
void underscores(void) {
|
|
__asm__("");
|
|
__asm__ __volatile__("");
|
|
__asm__ __inline__("");
|
|
// Note: goto is not supported with underscore prefix+suffix.
|
|
__asm__ goto("" ::::foo);
|
|
foo:;
|
|
}
|
|
|
|
void permutations(void) {
|
|
asm goto inline volatile("" ::::foo);
|
|
asm goto inline("");
|
|
asm goto volatile inline("" ::::foo);
|
|
asm goto volatile("");
|
|
asm inline goto volatile("" ::::foo);
|
|
asm inline goto("" ::::foo);
|
|
asm inline volatile goto("" ::::foo);
|
|
asm inline volatile("");
|
|
asm volatile goto("" ::::foo);
|
|
asm volatile inline goto("" ::::foo);
|
|
asm volatile inline("");
|
|
foo:;
|
|
}
|
|
|
|
void duplicates(void) {
|
|
asm volatile volatile(""); // expected-error {{duplicate asm qualifier 'volatile'}}
|
|
__asm__ __volatile__ __volatile__(""); // expected-error {{duplicate asm qualifier 'volatile'}}
|
|
asm inline inline(""); // expected-error {{duplicate asm qualifier 'inline'}}
|
|
__asm__ __inline__ __inline__(""); // expected-error {{duplicate asm qualifier 'inline'}}
|
|
asm goto goto("" ::::foo); // expected-error {{duplicate asm qualifier 'goto'}}
|
|
__asm__ goto goto("" ::::foo); // expected-error {{duplicate asm qualifier 'goto'}}
|
|
foo:;
|
|
}
|
|
|
|
// globals
|
|
asm ("");
|
|
asm volatile (""); // expected-error {{meaningless 'volatile' on asm outside function}}
|
|
asm inline (""); // expected-error {{meaningless 'inline' on asm outside function}}
|
|
asm goto (""::::noodle); // expected-error {{meaningless 'goto' on asm outside function}}
|
|
// expected-error@-1 {{expected ')'}}
|
|
// expected-note@-2 {{to match this '('}}
|