From 6b335d1948a94f3cea85b61717f72782416aea9d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 16 Nov 2016 03:36:29 +0000 Subject: Fix build break when the host C compiler is C89. llvm-svn: 287075 --- llvm/tools/llvm-c-test/attributes.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'llvm/tools/llvm-c-test/attributes.c') diff --git a/llvm/tools/llvm-c-test/attributes.c b/llvm/tools/llvm-c-test/attributes.c index 7f07a220ad3..c6beab1d31b 100644 --- a/llvm/tools/llvm-c-test/attributes.c +++ b/llvm/tools/llvm-c-test/attributes.c @@ -24,7 +24,8 @@ int llvm_test_function_attributes(void) { LLVMValueRef F = LLVMGetFirstFunction(M); while (F) { // Read attributes - for (int Idx = LLVMAttributeFunctionIndex, ParamCount = LLVMCountParams(F); + int Idx, ParamCount; + for (Idx = LLVMAttributeFunctionIndex, ParamCount = LLVMCountParams(F); Idx <= ParamCount; ++Idx) { int AttrCount = LLVMGetAttributeCountAtIndex(F, Idx); LLVMAttributeRef *Attrs = @@ -53,8 +54,9 @@ int llvm_test_callsite_attributes(void) { for (I = LLVMGetFirstInstruction(BB); I; I = LLVMGetNextInstruction(I)) { if (LLVMIsACallInst(I)) { // Read attributes - for (int Idx = LLVMAttributeFunctionIndex, - ParamCount = LLVMCountParams(F); + int Idx, ParamCount; + for (Idx = LLVMAttributeFunctionIndex, + ParamCount = LLVMCountParams(F); Idx <= ParamCount; ++Idx) { int AttrCount = LLVMGetCallSiteAttributeCount(I, Idx); LLVMAttributeRef *Attrs = (LLVMAttributeRef *)malloc( -- cgit v1.2.3