1 // RUN: %clang_analyze_cc1 -triple i386-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
2 // RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
3
foo(int cond)4 int foo(int cond)
5 {
6 label_true:
7 asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop);
8 return 0;
9 loop:
10 return 0;
11 }
12
13 // CHECK-LABEL: loop
14 // CHECK-NEXT: 0
15 // CHECK-NEXT: return
16 // CHECK-NEXT: Preds (1): B3
17 // CHECK-NEXT: Succs (1): B0
18
19 // CHECK-LABEL: label_true
20 // CHECK-NEXT: asm goto
21 // CHECK-NEXT: Preds (2): B3 B4
22 // CHECK-NEXT: Succs (3): B2 B3 B1
23
24
bar(int cond)25 int bar(int cond)
26 {
27 asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::L1, L2);
28 return 0;
29 L1:
30 L2:
31 return 0;
32 }
33
34 // CHECK: [B4]
35 // CHECK-NEXT: asm goto
36 // CHECK-NEXT: Preds (1): B5
37 // CHECK-NEXT: Succs (3): B3 B2 B1
38
zoo(int n)39 int zoo(int n)
40 {
41 A5:
42 A1:
43 asm goto("testl %0, %0; jne %l1;" :: "r"(n)::A1, A2, A3, A4, A5);
44 A2:
45 A3:
46 A4:
47 return 0;
48 }
49
50 // CHECK-LABEL: A1
51 // CHECK-NEXT: asm goto
52 // CHECK-NEXT: Preds (2): B5 B4
53 // CHECK-NEXT: Succs (5): B3 B4 B2 B1 B5
54