-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86-64] Don't initialize externally defined variables
At present, external variables such as stdout, stderr, ... are incorrectly treated as local variables initialized to 0. With this change references to such external variables are correctly emited as external variables with no need to be initialized to 0. [NFC] Renamed - files ExternalFunctions.* to IncludeFileInfo.* - class ExternalFunctions to IncludeFileInfo - static member fields of the class as appropriate. [Test] Added test to verify reference to externally defined variables.
- Loading branch information
1 parent
d8d8549
commit b09192e
Showing
12 changed files
with
114 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// REQUIRES: system-linux | ||
// RUN: clang -o %t %s | ||
// RUN: llvm-mctoll -d -I /usr/include/stdio.h %t | ||
// RUN: clang -o %t1 %t-dis.ll | ||
// RUN: %t1 2>&1 | FileCheck %s | ||
// CHECK: x = 0, y = 0, z = 1 | ||
// CHECK-EMPTY | ||
|
||
#include <stdio.h> | ||
|
||
int x; | ||
int y = 0; | ||
int z = 1; | ||
|
||
int main() { | ||
fprintf(stdout, "x = %d, y = %d, z = %d\n", x, y, z); | ||
|
||
return 0; | ||
} |