-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIR][CIRGen] Implement constant evaluation for integral builtins (#381)
- Loading branch information
1 parent
3d25ba9
commit dec1353
Showing
2 changed files
with
17 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir-enable -emit-cir %s -o - | FileCheck %s | ||
|
||
auto func() { | ||
return __builtin_strcmp("", ""); | ||
// CHECK: cir.func @_Z4funcv() -> !s32i extra( {inline = #cir.inline<no>, optnone = #cir.optnone} ) { | ||
// CHECK-NEXT: %0 = cir.alloca !s32i, cir.ptr <!s32i>, ["__retval"] {alignment = 4 : i64} loc(#loc2) | ||
// CHECK-NEXT: %1 = cir.const(#cir.int<0> : !s32i) : !s32i loc(#loc7) | ||
// CHECK-NEXT: cir.store %1, %0 : !s32i, cir.ptr <!s32i> loc(#loc8) | ||
// CHECK-NEXT: %2 = cir.load %0 : cir.ptr <!s32i>, !s32i loc(#loc8) | ||
// CHECK-NEXT: cir.return %2 : !s32i loc(#loc8) | ||
} |