Daniel Dunbar | 4776f03 | 2008-09-27 00:39:13 +0000 | [diff] [blame] | 1 | // 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 Dunbar | 9750972 | 2009-02-12 17:28:23 +0000 | [diff] [blame] | 10 | // 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 Dunbar | d79bb39 | 2009-02-12 23:32:54 +0000 | [diff] [blame] | 14 | // RUN: grep '@t13 =.*section "SECT"' %t && |
| 15 | // RUN: grep '@t14.x =.*section "SECT"' %t |
Daniel Dunbar | 4776f03 | 2008-09-27 00:39:13 +0000 | [diff] [blame] | 16 | |
Chris Lattner | 402b337 | 2008-03-03 03:28:21 +0000 | [diff] [blame] | 17 | void t1() __attribute__((noreturn)); |
| 18 | void t1() {} |
| 19 | |
Chris Lattner | 402b337 | 2008-03-03 03:28:21 +0000 | [diff] [blame] | 20 | void t2() __attribute__((nothrow)); |
| 21 | void t2() {} |
| 22 | |
Chris Lattner | 402b337 | 2008-03-03 03:28:21 +0000 | [diff] [blame] | 23 | void t3() __attribute__((weak)); |
| 24 | void t3() {} |
| 25 | |
Chris Lattner | e9d83be | 2008-03-04 18:08:48 +0000 | [diff] [blame] | 26 | void t4() __attribute__((visibility("hidden"))); |
Chris Lattner | 402b337 | 2008-03-03 03:28:21 +0000 | [diff] [blame] | 27 | void t4() {} |
| 28 | |
Chris Lattner | 402b337 | 2008-03-03 03:28:21 +0000 | [diff] [blame] | 29 | int t5 __attribute__((weak)) = 2; |
| 30 | |
Chris Lattner | e9d83be | 2008-03-04 18:08:48 +0000 | [diff] [blame] | 31 | int t6 __attribute__((visibility("protected"))); |
Chris Lattner | 0b3357e | 2008-03-03 03:45:26 +0000 | [diff] [blame] | 32 | |
Chris Lattner | 0b3357e | 2008-03-03 03:45:26 +0000 | [diff] [blame] | 33 | void t7() __attribute__((noreturn, nothrow)); |
| 34 | void t7() {} |
Nuno Lopes | 7853438 | 2008-06-08 15:45:52 +0000 | [diff] [blame] | 35 | |
Nuno Lopes | 7853438 | 2008-06-08 15:45:52 +0000 | [diff] [blame] | 36 | void __t8() {} |
| 37 | void t9() __attribute__((weak, alias("__t8"))); |
Daniel Dunbar | 9750972 | 2009-02-12 17:28:23 +0000 | [diff] [blame] | 38 | |
| 39 | void t10(void) __attribute__((section("SECT"))); |
| 40 | void t10(void) {} |
| 41 | void __attribute__((section("SECT"))) t11(void) {} |
| 42 | |
| 43 | int t12 __attribute__((section("SECT"))); |
| 44 | struct s0 { int x; }; |
Daniel Dunbar | d79bb39 | 2009-02-12 23:32:54 +0000 | [diff] [blame] | 45 | struct s0 t13 __attribute__((section("SECT"))) = { 0 }; |
| 46 | |
| 47 | void t14(void) { |
| 48 | static int x __attribute__((section("SECT"))) = 0; |
| 49 | } |