-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][bytecode] IntPointer::atOffset() should append (#104686)
... to current offset. This breaks other tests which this commit also fixes. Namely, getIndex() should return the integer representation for non-block pointers.
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s | ||
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s -fexperimental-new-constant-interpreter | FileCheck %s | ||
|
||
typedef __INTPTR_TYPE__ intptr_t; | ||
|
||
const intptr_t Z1 = (intptr_t)(((char*)-1LL) + 1); | ||
// CHECK: @Z1 = constant i64 0 | ||
|
||
const intptr_t Z2 = (intptr_t)(((char*)1LL) - 1); | ||
// CHECK: @Z2 = constant i64 0 | ||
|
||
struct A { | ||
char num_fields; | ||
}; | ||
struct B { | ||
char a, b[1]; | ||
}; | ||
const int A = (char *)(&( (struct B *)(16) )->b[0]) - (char *)(16); | ||
// CHECK: @A = constant i32 1 |