Add include needed for MSVC.
[clang/acc.git] / test / CodeGen / mangle.c
blob17d74ba71f0c55f55d0319c4eec9df3eb2fdd2e5
1 // RUN: clang-cc -triple i386-pc-linux-gnu -emit-llvm -o %t %s &&
2 // RUN: grep '@_Z2f0i' %t &&
3 // RUN: grep '@_Z2f0l' %t &&
5 // Make sure we mangle overloadable, even in C system headers.
7 # 1 "somesystemheader.h" 1 3 4
8 void __attribute__((__overloadable__)) f0(int a) {}
9 void __attribute__((__overloadable__)) f0(long b) {}
13 // These should get merged.
14 void foo() __asm__("bar");
15 void foo2() __asm__("bar");
17 // RUN: grep '@"\\01foo"' %t &&
18 // RUN: grep '@"\\01bar"' %t
20 int nux __asm__("foo");
21 extern float nux2 __asm__("foo");
23 int test() {
24 foo();
25 foo2();
27 return nux + nux2;
31 // Function becomes a variable.
32 void foo3() __asm__("var");
34 void test2() {
35 foo3();
37 int foo4 __asm__("var") = 4;
40 // Variable becomes a function
41 extern int foo5 __asm__("var2");
43 void test3() {
44 foo5 = 1;
47 void foo6() __asm__("var2");
48 void foo6() {
53 int foo7 __asm__("foo7") __attribute__((used));
54 float foo8 __asm__("foo7") = 42;