llvm.org GIT mirror llvm / 30f743e
[DebugInfo] Correct the assertion introduced in r266509 + update test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266512 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 3 years ago
2 changed file(s) with 4 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
18741874 unsigned Arg, unsigned Flags, ArrayRef Ops)
18751875 : DIVariable(C, DILocalVariableKind, Storage, Line, Ops), Arg(Arg),
18761876 Flags(Flags) {
1877 assert(Flags < ((1 << 16) - 1) && "DILocalVariable: Flags out of range");
1878 assert(Arg < ((1 << 16) - 1) && "DILocalVariable: Arg out of range");
1877 assert(Flags < (1 << 16) && "DILocalVariable: Flags out of range");
1878 assert(Arg < (1 << 16) && "DILocalVariable: Arg out of range");
18791879 }
18801880 ~DILocalVariable() = default;
18811881
18161816 DITypeRef Type = getDerivedType();
18171817 unsigned Arg = 6;
18181818 unsigned Flags = 7;
1819 unsigned NotFlags = (~Flags) & ((1 << 16) - 1);
18191820
18201821 auto *N =
18211822 DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg, Flags);
18461847 EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type,
18471848 Arg + 1, Flags));
18481849 EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg,
1849 ~Flags));
1850 NotFlags));
18501851
18511852 TempDILocalVariable Temp = N->clone();
18521853 EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));