Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc < %s -emit-llvm |
Chris Lattner | 1e0a390 | 2008-01-16 19:17:22 +0000 | [diff] [blame] | 2 | |
Chris Lattner | c8edf6b | 2008-02-06 21:20:34 +0000 | [diff] [blame] | 3 | void test1(int x) { |
Chris Lattner | 1e0a390 | 2008-01-16 19:17:22 +0000 | [diff] [blame] | 4 | switch (x) { |
5 | case 111111111111111111111111111111111111111: | ||||
6 | bar(); | ||||
7 | } | ||||
8 | } | ||||
9 | |||||
Chris Lattner | c8edf6b | 2008-02-06 21:20:34 +0000 | [diff] [blame] | 10 | // Mismatched type between return and function result. |
11 | int test2() { return; } | ||||
12 | void test3() { return 4; } | ||||
13 | |||||
Chris Lattner | f3b1862 | 2009-10-13 06:52:43 +0000 | [diff] [blame] | 14 | |
15 | void test4() { | ||||
16 | bar: | ||||
17 | baz: | ||||
18 | blong: | ||||
19 | bing: | ||||
20 | ; | ||||
Chris Lattner | 3ae9f48 | 2009-10-13 07:14:16 +0000 | [diff] [blame] | 21 | |
22 | // PR5131 | ||||
23 | static long x = &&bar - &&baz; | ||||
Chris Lattner | f3b1862 | 2009-10-13 06:52:43 +0000 | [diff] [blame] | 24 | static long y = &&baz; |
25 | &&bing; | ||||
26 | &&blong; | ||||
27 | if (y) | ||||
28 | goto *y; | ||||
29 | |||||
30 | goto *x; | ||||
31 | } | ||||
32 | |||||
33 | // PR3869 | ||||
34 | int test5(long long b) { goto *b; } | ||||
35 |