blob: e2bbb5a90a818952d99c9e7247fda2662f6cb0e2 [file] [log] [blame]
Chad Rosier7a0a31c2012-02-03 01:49:51 +00001// RUN: %clang_cc1 -Wno-error=return-type %s -emit-llvm-only
Chris Lattner1e0a3902008-01-16 19:17:22 +00002
Chris Lattnerc8edf6b2008-02-06 21:20:34 +00003void test1(int x) {
Chris Lattner1e0a3902008-01-16 19:17:22 +00004switch (x) {
5case 111111111111111111111111111111111111111:
6bar();
7}
8}
9
Chris Lattnerc8edf6b2008-02-06 21:20:34 +000010// Mismatched type between return and function result.
11int test2() { return; }
12void test3() { return 4; }
13
Chris Lattnerf3b18622009-10-13 06:52:43 +000014
15void test4() {
16bar:
17baz:
18blong:
19bing:
20 ;
Chris Lattner3ae9f482009-10-13 07:14:16 +000021
22// PR5131
23static long x = &&bar - &&baz;
Chris Lattnerf3b18622009-10-13 06:52:43 +000024static long y = &&baz;
25 &&bing;
26 &&blong;
27 if (y)
28 goto *y;
29
30 goto *x;
31}
32
33// PR3869
John McCallb60a77e2010-08-01 00:26:45 +000034int test5(long long b) {
35 static void *lbls[] = { &&lbl };
36 goto *b;
37 lbl:
38 return 0;
39}
Chris Lattnerf3b18622009-10-13 06:52:43 +000040