Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp

Issue 183273009: Prep for merging 3.4: Undo changes from 3.3 branch (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Retry Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/Transforms/LoopVectorize/value-ptr-bug.ll ('k') | utils/release/tag.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- MCJITTest.cpp - Unit tests for the MCJIT ---------------------------===// 1 //===- MCJITTest.cpp - Unit tests for the MCJIT ---------------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This test suite verifies basic MCJIT functionality when invoked form the C 10 // This test suite verifies basic MCJIT functionality when invoked form the C
(...skipping 30 matching lines...) Expand all
41 }; 41 };
42 42
43 TEST_F(MCJITCAPITest, simple_function) { 43 TEST_F(MCJITCAPITest, simple_function) {
44 SKIP_UNSUPPORTED_PLATFORM; 44 SKIP_UNSUPPORTED_PLATFORM;
45 45
46 char *error = 0; 46 char *error = 0;
47 47
48 // Creates a function that returns 42, compiles it, and runs it. 48 // Creates a function that returns 42, compiles it, and runs it.
49 49
50 LLVMModuleRef module = LLVMModuleCreateWithName("simple_module"); 50 LLVMModuleRef module = LLVMModuleCreateWithName("simple_module");
51
52 LLVMSetTarget(module, HostTriple.c_str());
53 51
54 LLVMValueRef function = LLVMAddFunction( 52 LLVMValueRef function = LLVMAddFunction(
55 module, "simple_function", LLVMFunctionType(LLVMInt32Type(), 0, 0, 0)); 53 module, "simple_function", LLVMFunctionType(LLVMInt32Type(), 0, 0, 0));
56 LLVMSetFunctionCallConv(function, LLVMCCallConv); 54 LLVMSetFunctionCallConv(function, LLVMCCallConv);
57 55
58 LLVMBasicBlockRef entry = LLVMAppendBasicBlock(function, "entry"); 56 LLVMBasicBlockRef entry = LLVMAppendBasicBlock(function, "entry");
59 LLVMBuilderRef builder = LLVMCreateBuilder(); 57 LLVMBuilderRef builder = LLVMCreateBuilder();
60 LLVMPositionBuilderAtEnd(builder, entry); 58 LLVMPositionBuilderAtEnd(builder, entry);
61 LLVMBuildRet(builder, LLVMConstInt(LLVMInt32Type(), 42, 0)); 59 LLVMBuildRet(builder, LLVMConstInt(LLVMInt32Type(), 42, 0));
62 60
(...skipping 25 matching lines...) Expand all
88 void *raw; 86 void *raw;
89 int (*usable)(); 87 int (*usable)();
90 } functionPointer; 88 } functionPointer;
91 functionPointer.raw = LLVMGetPointerToGlobal(engine, function); 89 functionPointer.raw = LLVMGetPointerToGlobal(engine, function);
92 90
93 EXPECT_EQ(42, functionPointer.usable()); 91 EXPECT_EQ(42, functionPointer.usable());
94 92
95 LLVMDisposeExecutionEngine(engine); 93 LLVMDisposeExecutionEngine(engine);
96 } 94 }
97 95
OLDNEW
« no previous file with comments | « test/Transforms/LoopVectorize/value-ptr-bug.ll ('k') | utils/release/tag.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698