blob: ad5cb6278134c4711d00db0b91e5c8c76b20a386 [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 +00004// Mismatched type between return and function result.
5int test2() { return; }
6void test3() { return 4; }
7
Chris Lattnerf3b18622009-10-13 06:52:43 +00008
9void test4() {
10bar:
11baz:
12blong:
13bing:
14 ;
Chris Lattner3ae9f482009-10-13 07:14:16 +000015
16// PR5131
17static long x = &&bar - &&baz;
Chris Lattnerf3b18622009-10-13 06:52:43 +000018static long y = &&baz;
19 &&bing;
20 &&blong;
21 if (y)
22 goto *y;
23
24 goto *x;
25}
26
27// PR3869
John McCallb60a77e2010-08-01 00:26:45 +000028int test5(long long b) {
29 static void *lbls[] = { &&lbl };
30 goto *b;
31 lbl:
32 return 0;
33}
Chris Lattnerf3b18622009-10-13 06:52:43 +000034