27 lines · c
1// RUN: %clang_cc1 -ffreestanding -emit-llvm -o - -std=c2x %s | FileCheck %s2// RUN: %clang_cc1 -ffreestanding -std=c17 -verify %s3 4/* WG14 N2826: Clang 175 * Add annotations for unreachable control flow v26 */7#include <stddef.h>8 9enum E {10 Zero,11 One,12 Two,13};14 15int test(enum E e) {16 switch (e) {17 case Zero: return 0;18 case One: return 1;19 case Two: return 2;20 }21 unreachable(); // expected-error {{call to undeclared function 'unreachable'}}22}23 24// CHECK: switch i32 %0, label %[[EPILOG:.+]] [25// CHECK: [[EPILOG]]:26// CHECK-NEXT: unreachable27