minix/external/bsd/llvm/dist/clang/test/CodeGen/global-decls.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

21 lines
604 B
C

// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s
// RUN: grep '@g0_ext = extern_weak global i32' %t
extern int g0_ext __attribute__((weak));
// RUN: grep 'declare extern_weak i32 @g1_ext()' %t
extern int __attribute__((weak)) g1_ext (void);
// RUN: grep '@g0_common = weak global i32' %t
int g0_common __attribute__((weak));
// RUN: grep '@g0_def = weak global i32' %t
int g0_def __attribute__((weak)) = 52;
// RUN: grep 'define weak i32 @g1_def()' %t
int __attribute__((weak)) g1_def (void) { return 0; }
// Force _ext references
void f0() {
int a = g0_ext;
int b = g1_ext();
}