1 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
2 // RUN: grep xglobWeak | grep linkonce | count 1
3 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
4 // RUN: grep xextWeak | grep linkonce | count 1
5 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
6 // RUN: grep xWeaknoinline | grep weak | count 1
7 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
8 // RUN: grep xWeakextnoinline | grep weak | count 1
9 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
10 // RUN: grep xglobnoWeak | grep linkonce | count 1
11 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
12 // RUN: grep xstatnoWeak | grep internal | count 1
13 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
14 // RUN: grep xextnoWeak | grep linkonce | count 1
15 inline int xglobWeak(int) __attribute__((weak
));
16 inline int xglobWeak (int i
) {
19 inline int xextWeak(int) __attribute__((weak
));
20 extern inline int xextWeak (int i
) {
23 int xWeaknoinline(int) __attribute__((weak
));
24 int xWeaknoinline(int i
) {
27 int xWeakextnoinline(int) __attribute__((weak
));
28 extern int xWeakextnoinline(int i
) {
31 inline int xglobnoWeak (int i
) {
34 static inline int xstatnoWeak (int i
) {
37 extern inline int xextnoWeak (int i
) {
41 return xglobnoWeak(y
)+xstatnoWeak(y
)+xextnoWeak(y
)+
42 xglobWeak(y
)+xextWeak(y
)+
43 xWeakextnoinline(y
)+xWeaknoinline(y
);