brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 1955c2c Raw
34 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -verify -Wunreachable-code %s2// RUN: %clang_cc1 -triple aarch64-unknown-linux-gnu -target-feature +fullfp16 -verify -Wunreachable-code %s3// REQUIRES: aarch64-registered-target4 5// =======  __fp16 version  =======6static void test_fp16(__fp16 &x) {7  if (x != 0 || x != 1.0) {           // expected-note {{}} no-crash8    x = 0.9;9  } else10    x = 0.8;                          // expected-warning{{code will never be executed}}11}12 13static void test_fp16_b(__fp16 &x) {14  if (x != 1 && x == 1.0) {           // expected-note {{}} no-crash15    x = 0.9;                          // expected-warning{{code will never be executed}}16  } else17    x = 0.8;18}19 20// =======  _Float16 version  =======21static void test_f16(_Float16 &x) {22  if (x != 0 || x != 1.0) {           // expected-note {{}} no-crash23    x = 0.9;24  } else25    x = 0.8;                          // expected-warning{{code will never be executed}}26}27 28static void test_f16_b(_Float16 &x) {29  if (x != 1 && x == 1.0) {           // expected-note {{}} no-crash30    x = 0.9;                          // expected-warning{{code will never be executed}}31  } else32    x = 0.8;33}34