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