27 lines · c
1// RUN: %clang -target i386-unknown-unknown -S -emit-llvm -std=gnu89 -o - %s | FileCheck %s2// RUN: %clang -target i386-unknown-unknown -S -emit-llvm -fgnu89-inline -o - %s | FileCheck %s3// PR52534 5// If an extern inline function is redefined, functions should call the6// redefinition.7extern inline int f(int a) {return a;}8int g(void) {return f(0);}9// CHECK: call i32 @f10int f(int b) {return 1+b;}11// CHECK: load i32, ptr %{{.*}}12// CHECK: add nsw i32 1, %{{.*}}13int h(void) {return f(1);}14// CHECK: call i32 @f15 16// It shouldn't matter if the function was redefined static.17extern inline int f2(int a, int b) {return a+b;}18int g2(void) {return f2(0,1);}19// CHECK: call i32 @f220static int f2(int a, int b) {return a*b;}21// CHECK: load i32, ptr %{{.*}}22// CHECK: load i32, ptr %{{.*}}23// CHECK: mul nsw i32 %{{.*}}, %{{.*}}24int h2(void) {return f2(1,2);}25// CHECK: call i32 @f226 27