Chad Rosier | 7a0a31c | 2012-02-03 01:49:51 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Wno-error=return-type %s -emit-llvm-only |
NAKAMURA Takumi | b774d73 | 2012-09-12 10:45:40 +0000 | [diff] [blame] | 2 | // REQUIRES: LP64 |
Chris Lattner | 1e0a390 | 2008-01-16 19:17:22 +0000 | [diff] [blame] | 3 | |
Chris Lattner | c8edf6b | 2008-02-06 21:20:34 +0000 | [diff] [blame] | 4 | // Mismatched type between return and function result. |
5 | int test2() { return; } | ||||
6 | void test3() { return 4; } | ||||
7 | |||||
Chris Lattner | f3b1862 | 2009-10-13 06:52:43 +0000 | [diff] [blame] | 8 | |
9 | void test4() { | ||||
10 | bar: | ||||
11 | baz: | ||||
12 | blong: | ||||
13 | bing: | ||||
14 | ; | ||||
Chris Lattner | 3ae9f48 | 2009-10-13 07:14:16 +0000 | [diff] [blame] | 15 | |
16 | // PR5131 | ||||
17 | static long x = &&bar - &&baz; | ||||
Chris Lattner | f3b1862 | 2009-10-13 06:52:43 +0000 | [diff] [blame] | 18 | static long y = &&baz; |
19 | &&bing; | ||||
20 | &&blong; | ||||
21 | if (y) | ||||
22 | goto *y; | ||||
23 | |||||
24 | goto *x; | ||||
25 | } | ||||
26 | |||||
27 | // PR3869 | ||||
John McCall | b60a77e | 2010-08-01 00:26:45 +0000 | [diff] [blame] | 28 | int test5(long long b) { |
29 | static void *lbls[] = { &&lbl }; | ||||
30 | goto *b; | ||||
31 | lbl: | ||||
32 | return 0; | ||||
33 | } | ||||
Chris Lattner | f3b1862 | 2009-10-13 06:52:43 +0000 | [diff] [blame] | 34 |