xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/statements.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -Wno-error=return-type %s -emit-llvm-only
2*f4a2713aSLionel Sambuc // REQUIRES: LP64
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc // Mismatched type between return and function result.
test2()5*f4a2713aSLionel Sambuc int test2() { return; }
test3()6*f4a2713aSLionel Sambuc void test3() { return 4; }
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc 
test4()9*f4a2713aSLionel Sambuc void test4() {
10*f4a2713aSLionel Sambuc bar:
11*f4a2713aSLionel Sambuc baz:
12*f4a2713aSLionel Sambuc blong:
13*f4a2713aSLionel Sambuc bing:
14*f4a2713aSLionel Sambuc  ;
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc // PR5131
17*f4a2713aSLionel Sambuc static long x = &&bar - &&baz;
18*f4a2713aSLionel Sambuc static long y = &&baz;
19*f4a2713aSLionel Sambuc   &&bing;
20*f4a2713aSLionel Sambuc   &&blong;
21*f4a2713aSLionel Sambuc   if (y)
22*f4a2713aSLionel Sambuc     goto *y;
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc   goto *x;
25*f4a2713aSLionel Sambuc }
26*f4a2713aSLionel Sambuc 
27*f4a2713aSLionel Sambuc // PR3869
test5(long long b)28*f4a2713aSLionel Sambuc int test5(long long b) {
29*f4a2713aSLionel Sambuc   static void *lbls[] = { &&lbl };
30*f4a2713aSLionel Sambuc   goto *b;
31*f4a2713aSLionel Sambuc  lbl:
32*f4a2713aSLionel Sambuc   return 0;
33*f4a2713aSLionel Sambuc }
34*f4a2713aSLionel Sambuc 
35