2010-03-31 04:24:48 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
|
2009-04-04 08:49:38 +08:00
|
|
|
|
|
|
|
#define FASTCALL __attribute__((regparm(2)))
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int aaa;
|
|
|
|
double bbbb;
|
|
|
|
int ccc[200];
|
|
|
|
} foo;
|
|
|
|
|
2010-03-31 06:15:11 +08:00
|
|
|
typedef void (*FType)(int, int) __attribute ((regparm (3), stdcall));
|
|
|
|
FType bar;
|
|
|
|
|
2011-02-19 10:53:41 +08:00
|
|
|
extern void FASTCALL reduced(char b, double c, foo* d, double e, int f);
|
2009-04-04 08:49:38 +08:00
|
|
|
|
2010-06-19 05:30:25 +08:00
|
|
|
// PR7025
|
|
|
|
void FASTCALL f1(int i, int j, int k);
|
[CodeGenModule] Assume dso_local for -fpic -fno-semantic-interposition
Summary:
Clang -fpic defaults to -fno-semantic-interposition (GCC -fpic defaults
to -fsemantic-interposition).
Users need to specify -fsemantic-interposition to get semantic
interposition behavior.
Semantic interposition is currently a best-effort feature. There may
still be some cases where it is not handled well.
Reviewers: peter.smith, rnk, serge-sans-paille, sfertile, jfb, jdoerfert
Subscribers: dschuff, jyknight, dylanmckay, nemanjai, jvesely, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, arphaman, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73865
2020-02-03 04:23:47 +08:00
|
|
|
// CHECK-LABEL: define dso_local void @f1(i32 inreg %i, i32 inreg %j, i32 %k)
|
2010-06-19 05:30:25 +08:00
|
|
|
void f1(int i, int j, int k) { }
|
|
|
|
|
2009-04-04 08:49:38 +08:00
|
|
|
int
|
|
|
|
main(void) {
|
2013-02-01 07:17:12 +08:00
|
|
|
// CHECK: call void @reduced(i8 inreg signext 0, {{.*}} %struct.foo* inreg null
|
2009-09-09 23:08:12 +08:00
|
|
|
reduced(0, 0.0, 0, 0.0, 0);
|
2010-03-31 07:50:00 +08:00
|
|
|
// CHECK: call x86_stdcallcc void {{.*}}(i32 inreg 1, i32 inreg 2)
|
2010-03-31 06:15:11 +08:00
|
|
|
bar(1,2);
|
2009-04-04 08:49:38 +08:00
|
|
|
}
|