blob: 171c81081a4ace81c0bdf5c7e7aff37abefefee0 [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 &&
Daniel Dunbard79bb392009-02-12 23:32:54 +000014// RUN: grep '@t13 =.*section "SECT"' %t &&
15// RUN: grep '@t14.x =.*section "SECT"' %t
Daniel Dunbar4776f032008-09-27 00:39:13 +000016
Chris Lattner402b3372008-03-03 03:28:21 +000017void t1() __attribute__((noreturn));
18void t1() {}
19
Chris Lattner402b3372008-03-03 03:28:21 +000020void t2() __attribute__((nothrow));
21void t2() {}
22
Chris Lattner402b3372008-03-03 03:28:21 +000023void t3() __attribute__((weak));
24void t3() {}
25
Chris Lattnere9d83be2008-03-04 18:08:48 +000026void t4() __attribute__((visibility("hidden")));
Chris Lattner402b3372008-03-03 03:28:21 +000027void t4() {}
28
Chris Lattner402b3372008-03-03 03:28:21 +000029int t5 __attribute__((weak)) = 2;
30
Chris Lattnere9d83be2008-03-04 18:08:48 +000031int t6 __attribute__((visibility("protected")));
Chris Lattner0b3357e2008-03-03 03:45:26 +000032
Chris Lattner0b3357e2008-03-03 03:45:26 +000033void t7() __attribute__((noreturn, nothrow));
34void t7() {}
Nuno Lopes78534382008-06-08 15:45:52 +000035
Nuno Lopes78534382008-06-08 15:45:52 +000036void __t8() {}
37void t9() __attribute__((weak, alias("__t8")));
Daniel Dunbar97509722009-02-12 17:28:23 +000038
39void t10(void) __attribute__((section("SECT")));
40void t10(void) {}
41void __attribute__((section("SECT"))) t11(void) {}
42
43int t12 __attribute__((section("SECT")));
44struct s0 { int x; };
Daniel Dunbard79bb392009-02-12 23:32:54 +000045struct s0 t13 __attribute__((section("SECT"))) = { 0 };
46
47void t14(void) {
48 static int x __attribute__((section("SECT"))) = 0;
49}