blob: aa4e3efb1d50ebedae9ae34d50f0d0c3112f425c [file] [log] [blame]
Daniel Dunbar4776f032008-09-27 00:39:13 +00001// RUN: clang -emit-llvm -o %t %s &&
2// RUN: grep 't1.*noreturn' %t &&
3// RUN: grep 't2.*nounwind' %t &&
4// RUN: grep 'weak.*t3' %t &&
5// RUN: grep 'hidden.*t4' %t &&
6// RUN: grep 't5.*weak' %t &&
7// RUN: grep 't6.*protected' %t &&
8// RUN: grep 't7.*noreturn' %t &&
9// RUN: grep 't7.*nounwind' %t &&
Daniel Dunbar97509722009-02-12 17:28:23 +000010// RUN: grep 't9.*alias.*weak.*t8' %t &&
11// RUN: grep '@t10().*section "SECT"' %t &&
12// RUN: grep '@t11().*section "SECT"' %t &&
13// RUN: grep '@t12 =.*section "SECT"' %t &&
14// RUN: grep '@t13 =.*section "SECT"' %t
Daniel Dunbar4776f032008-09-27 00:39:13 +000015
Chris Lattner402b3372008-03-03 03:28:21 +000016void t1() __attribute__((noreturn));
17void t1() {}
18
Chris Lattner402b3372008-03-03 03:28:21 +000019void t2() __attribute__((nothrow));
20void t2() {}
21
Chris Lattner402b3372008-03-03 03:28:21 +000022void t3() __attribute__((weak));
23void t3() {}
24
Chris Lattnere9d83be2008-03-04 18:08:48 +000025void t4() __attribute__((visibility("hidden")));
Chris Lattner402b3372008-03-03 03:28:21 +000026void t4() {}
27
Chris Lattner402b3372008-03-03 03:28:21 +000028int t5 __attribute__((weak)) = 2;
29
Chris Lattnere9d83be2008-03-04 18:08:48 +000030int t6 __attribute__((visibility("protected")));
Chris Lattner0b3357e2008-03-03 03:45:26 +000031
Chris Lattner0b3357e2008-03-03 03:45:26 +000032void t7() __attribute__((noreturn, nothrow));
33void t7() {}
Nuno Lopes78534382008-06-08 15:45:52 +000034
Nuno Lopes78534382008-06-08 15:45:52 +000035void __t8() {}
36void t9() __attribute__((weak, alias("__t8")));
Daniel Dunbar97509722009-02-12 17:28:23 +000037
38void t10(void) __attribute__((section("SECT")));
39void t10(void) {}
40void __attribute__((section("SECT"))) t11(void) {}
41
42int t12 __attribute__((section("SECT")));
43struct s0 { int x; };
44struct s0 t13 __attribute__ ((section ("SECT"))) = { 0 };