blob: 45bbd9ac024fb295a457dd756aa3248e4e37a283 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc < %s -emit-llvm
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
34int test5(long long b) { goto *b; }
35