1 ; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s
3 ; We used to not mark NZCV as being used in the continuation basic-block
4 ; when lowering a 128-bit "select" to branches. This meant a subsequent use
5 ; of the same flags gave an internal fault here.
7 declare void @foo(fp128)
9 define double @test_f128csel_flags(i32 %lhs, fp128 %a, fp128 %b) nounwind {
10 ; CHECK: test_f128csel_flags
12 %tst = icmp ne i32 %lhs, 42
13 %val = select i1 %tst, fp128 %a, fp128 %b
17 call void @foo(fp128 %val)
18 %retval = select i1 %tst, double 4.0, double 5.0
20 ; It's also reasonably important that the actual fcsel comes before the
21 ; function call since bl may corrupt NZCV. We were doing the right thing anyway,
22 ; but just as well test it while we're here.
23 ; CHECK: fcsel {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}, ne