teak-llvm/clang/test/Sema/pragma-weak.c
Rafael Espindola d53ffa0a70 Treat aliases as definitions.
This fixes pr17639.

Before this patch clang would consider

void foo(void) __attribute((alias("__foo")));

a declaration. It now correctly handles it as a definition.

Initial patch by Alp Toker. I added support for variables.

llvm-svn: 193200
2013-10-22 21:39:03 +00:00

12 lines
493 B
C

// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
void __both3(void);
#pragma weak both3 = __both3 // expected-note {{previous definition}}
void both3(void) __attribute((alias("__both3"))); // expected-error {{redefinition of 'both3'}}
void __both3(void) {}
void __a3(void) __attribute((noinline));
#pragma weak a3 = __a3 // expected-note {{previous definition}}
void a3(void) __attribute((alias("__a3"))); // expected-error {{redefinition of 'a3'}}
void __a3(void) {}