Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / no-junk-ftrunc.c
blob44638e0644263edfffd95b40bbd1215e2df6b05d
1 // RUN: %clang_cc1 -fno-strict-float-cast-overflow %s -emit-llvm -o - | FileCheck %s --check-prefix=NOSTRICT
3 // When compiling with non-standard semantics, use intrinsics to inhibit the optimizer.
4 // This used to require a function attribute, so we check that it is NOT here anymore.
6 // NOSTRICT-LABEL: main
7 // NOSTRICT: call i32 @llvm.fptosi.sat.i32.f64
8 // NOSTRICT: call i32 @llvm.fptoui.sat.i32.f64
9 // NOSTRICT-NOT: strict-float-cast-overflow
11 // The workaround attribute is not applied by default.
13 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s --check-prefix=STRICT
14 // STRICT-LABEL: main
15 // STRICT: = fptosi
16 // STRICT: = fptoui
17 // STRICT-NOT: strict-float-cast-overflow
20 int main(void) {
21 double d = 1e20;
22 return (int)d != 1e20 && (unsigned)d != 1e20;