mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-21 04:25:45 -04:00

This patch implements global named registers in Clang, lowering to the just created intrinsics in LLVM (@llvm.read/write_register). A new type of LValue had to be created (Register), which just adds support to carry the metadata node containing the name of the register. Two new methods to emit loads and stores interoperate with another to emit the named metadata node. No guarantees are being made and only non-allocatable global variable named registers are being supported. Local named register support is unchanged. llvm-svn: 209149
28 lines
1.0 KiB
C
28 lines
1.0 KiB
C
// RUN: %clang_cc1 %s -fsyntax-only -verify
|
|
|
|
// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
|
|
typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{typedef requires a name}}
|
|
|
|
|
|
// PR2017
|
|
void x();
|
|
int a() {
|
|
int r[x()]; // expected-error {{size of array has non-integer type 'void'}}
|
|
|
|
static y ?; // expected-error{{unknown type name 'y'}} \
|
|
expected-error{{expected identifier or '('}}
|
|
}
|
|
|
|
int; // expected-warning {{declaration does not declare anything}}
|
|
typedef int; // expected-warning {{typedef requires a name}}
|
|
const int; // expected-warning {{declaration does not declare anything}}
|
|
struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}}
|
|
typedef int I;
|
|
I; // expected-warning {{declaration does not declare anything}}
|
|
|
|
|
|
|
|
// rdar://6880449
|
|
register int test1; // expected-error {{illegal storage class on file-scoped variable}}
|
|
|