1 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xglobWeak | \
2 // RUN: grep weak | count 1
3 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xextWeak | \
4 // RUN: grep weak | count 1
5 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
6 // RUN: grep xWeaknoinline | grep weak | count 1
7 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
8 // RUN: grep xWeakextnoinline | grep weak | count 1
9 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
10 // RUN: grep xglobnoWeak | grep -v internal | grep -v weak | \
11 // RUN: grep -v linkonce | count 1
12 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
13 // RUN: grep xstatnoWeak | grep internal | count 1
14 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep declare | \
15 // RUN: grep xextnoWeak | grep -v internal | grep -v weak | \
16 // RUN: grep -v linkonce | count 1
17 inline int xglobWeak(int) __attribute__((weak
));
18 inline int xglobWeak (int i
) {
21 inline int xextWeak(int) __attribute__((weak
));
22 extern inline int xextWeak (int i
) {
25 int xWeaknoinline(int) __attribute__((weak
));
26 int xWeaknoinline(int i
) {
29 int xWeakextnoinline(int) __attribute__((weak
));
30 extern int xWeakextnoinline(int i
) {
33 inline int xglobnoWeak (int i
) {
36 static inline int xstatnoWeak (int i
) {
39 extern inline int xextnoWeak (int i
) {
43 return xglobnoWeak(y
)+xstatnoWeak(y
)+xextnoWeak(y
)+
44 xglobWeak(y
)+xextWeak(y
)+
45 xWeakextnoinline(y
)+xWeaknoinline(y
);