StmtPrinter: factor out arg printing code to PrintCallArgs
[clang.git] / test / CodeGen / mangle.c
blob93d424a85dad371a8ba463eb4e0632283879d64d
1 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
3 // CHECK: @"\01foo"
5 // Make sure we mangle overloadable, even in C system headers.
6 # 1 "somesystemheader.h" 1 3 4
7 // CHECK: @_Z2f0i
8 void __attribute__((__overloadable__)) f0(int a) {}
9 // CHECK: @_Z2f0l
10 void __attribute__((__overloadable__)) f0(long b) {}
12 // CHECK: @"\01bar"
14 // These should get merged.
15 void foo() __asm__("bar");
16 void foo2() __asm__("bar");
18 int nux __asm__("foo");
19 extern float nux2 __asm__("foo");
21 int test() {
22 foo();
23 foo2();
25 return nux + nux2;
29 // Function becomes a variable.
30 void foo3() __asm__("var");
32 void test2() {
33 foo3();
35 int foo4 __asm__("var") = 4;
38 // Variable becomes a function
39 extern int foo5 __asm__("var2");
41 void test3() {
42 foo5 = 1;
45 void foo6() __asm__("var2");
46 void foo6() {
51 int foo7 __asm__("foo7") __attribute__((used));
52 float foo8 __asm__("foo7") = 42;
54 // PR4412
55 int func(void);
56 extern int func (void) __asm__ ("FUNC");
58 // CHECK: @"\01FUNC"
59 int func(void) {
60 return 42;
63 // CHECK: @_Z4foo9Dv4_f
64 typedef __attribute__(( vector_size(16) )) float float4;
65 void __attribute__((__overloadable__)) foo9(float4 f) {}