Teach mergefunc that intptr_t is the same width as a pointer. We still can't
[llvm.git] / test / FrontendC / 2007-04-11-InlineStorageClassC99.c
blob6031071e3464e3f47ea550c59bc79e33261189c4
1 // RUN: %llvmgcc -std=c99 %s -S -O0 -o - | grep declare | \
2 // RUN: grep xglobWeak | grep extern_weak | count 1
3 // RUN: %llvmgcc -std=c99 %s -S -O0 -o - | grep define | \
4 // RUN: grep xextWeak | grep weak | count 1
5 // RUN: %llvmgcc -std=c99 %s -S -O0 -o - | grep define | \
6 // RUN: grep xWeaknoinline | grep weak | count 1
7 // RUN: %llvmgcc -std=c99 %s -S -O0 -o - | grep define | \
8 // RUN: grep xWeakextnoinline | grep weak | count 1
9 // RUN: %llvmgcc -std=c99 %s -S -O0 -o - | grep define | \
10 // RUN: grep xglobnoWeak | grep available_externally | grep -v weak | \
11 // RUN: grep -v linkonce | count 1
12 // RUN: %llvmgcc -std=c99 %s -S -O0 -o - | grep define | \
13 // RUN: grep xstatnoWeak | grep internal | count 1
14 // RUN: %llvmgcc -std=c99 %s -S -O0 -o - | grep define | \
15 // RUN: grep xextnoWeak | grep -v available_externally | grep -v weak | \
16 // RUN: grep -v linkonce | count 1
17 inline int xglobWeak(int) __attribute__((weak));
18 inline int xglobWeak (int i) {
19 return i*2;
21 inline int xextWeak(int) __attribute__((weak));
22 extern inline int xextWeak (int i) {
23 return i*4;
25 int xWeaknoinline(int) __attribute__((weak));
26 int xWeaknoinline(int i) {
27 return i*8;
29 int xWeakextnoinline(int) __attribute__((weak));
30 extern int xWeakextnoinline(int i) {
31 return i*16;
33 inline int xglobnoWeak (int i) {
34 return i*32;
36 static inline int xstatnoWeak (int i) {
37 return i*64;
39 extern inline int xextnoWeak (int i) {
40 return i*128;
42 int j(int y) {
43 return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+
44 xglobWeak(y)+xextWeak(y)+
45 xWeakextnoinline(y)+xWeaknoinline(y);