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