summaryrefslogtreecommitdiff
path: root/test/CodeGen/unreachable-ret.c
blob: 386b83e9ef6bb5f52ff965caa56bd9c2f939804b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s

extern void abort() __attribute__((noreturn));

void f1() {
  abort();
}
// CHECK-LABEL: define {{.*}}void @f1()
// CHECK-NEXT: entry:
// CHECK-NEXT:   call void @abort()
// CHECK-NEXT:   unreachable
// CHECK-NEXT: }

void *f2() {
  abort();
  return 0;
}
// CHECK-LABEL: define {{.*}}i8* @f2()
// CHECK-NEXT: entry:
// CHECK-NEXT:   call void @abort()
// CHECK-NEXT:   unreachable
// CHECK-NEXT: }