blob: bcb1400dd580e0d48f103d4671373cd74e886a98 [file] [log] [blame]
Daniel Dunbar0c4eda52009-02-20 23:09:27 +00001// RUN: clang -arch i386 -emit-llvm -o %t %s &&
2// RUN: grep '@_Z2f0i' %t &&
Chris Lattner65749062009-03-21 08:24:40 +00003// RUN: grep '@_Z2f0l' %t &&
Daniel Dunbar0c4eda52009-02-20 23:09:27 +00004
5// Make sure we mangle overloadable, even in C system headers.
6
7# 1 "somesystemheader.h" 1 3 4
8void __attribute__((__overloadable__)) f0(int a) {}
9void __attribute__((__overloadable__)) f0(long b) {}
Chris Lattner65749062009-03-21 08:24:40 +000010
11
12
13// These should get merged.
14void foo() __asm__("bar");
15void foo2() __asm__("bar");
16
17// RUN: grep '@"\\01foo"' %t &&
18// RUN: grep '@"\\01bar"' %t
19
20int nux __asm__("foo");
21extern float nux2 __asm__("foo");
22
23int test() {
24 foo();
25 foo2();
26
27 return nux + nux2;
28}
Chris Lattner149927c2009-03-21 09:16:30 +000029
30
31// Function becomes a variable.
32void foo3() __asm__("var");
33
34void test2() {
35 foo3();
36}
37int foo4 __asm__("var") = 4;
38