Debian Codegraph @

clang/test/Sema/warn-unreachable_crash.cpp

raw
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -verify -Wunreachable-code %s
2 // RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -target-feature +fullfp16 -verify -Wunreachable-code %s
3 // REQUIRES: aarch64-registered-target
4
5 // ======= __fp16 version =======
6 static void test_fp16(__fp16 &x) {
7 if (x != 0 || x != 1.0) { // expected-note {{}} no-crash
8 x = 0.9;
9 } else
10 x = 0.8; // expected-warning{{code will never be executed}}
11 }
12
13 static void test_fp16_b(__fp16 &x) {
14 if (x != 1 && x == 1.0) { // expected-note {{}} no-crash
15 x = 0.9; // expected-warning{{code will never be executed}}
16 } else
17 x = 0.8;
18 }
19
20 // ======= _Float16 version =======
21 static void test_f16(_Float16 &x) {
22 if (x != 0 || x != 1.0) { // expected-note {{}} no-crash
23 x = 0.9;
24 } else
25 x = 0.8; // expected-warning{{code will never be executed}}
26 }
27
28 static void test_f16_b(_Float16 &x) {
29 if (x != 1 && x == 1.0) { // expected-note {{}} no-crash
30 x = 0.9; // expected-warning{{code will never be executed}}
31 } else
32 x = 0.8;
33 }