1 // RUN: %clang_cc1 -no-opaque-pointers -emit-llvm-bc -disable-llvm-passes -o %t.bc %s 2 // RUN: llvm-dis %t.bc -o - | FileCheck %s 3 4 // Test case for PR45426. Make sure we do not crash while writing bitcode 5 // containing a simplify-able fneg constant expression. Check that the created 6 // bitcode file can be disassembled and has the constant expressions simplified. 7 // 8 // CHECK-LABEL define i32 @main() 9 // CHECK: entry: 10 // CHECK-NEXT: %retval = alloca i32 11 // CHECK-NEXT: store i32 0, i32* %retval 12 // CHECK-NEXT: [[LV:%.*]] = load float*, float** @c 13 // CHECK-NEXT: store float 1.000000e+00, float* [[LV]], align 4 14 // CHECK-NEXT: ret i32 -1 15 16 int a[], b; 17 float *c; 18 int main(void) { 19 return -(*c = &b != a); 20 } 21