Skip to content

Commit 79faa08

Browse files
Revert "cir-translate: Use default target triple instead of x86 if no target was set explicitly" (#1509)
Reverts #1482 @mmha this is crashing on macos on asserts build: ``` FAIL: Clang :: CIR/Tools/cir-translate/warn-default-triple.cir (472 of 552) ******************** TEST 'Clang :: CIR/Tools/cir-translate/warn-default-triple.cir' FAILED ******************** Exit Code: 134 Command Output (stdout): -- Assertion failed: (!DataLayoutString.empty() && "Uninitialized DataLayout!"), function getDataLayoutString, file TargetInfo.h, line 1282. ``` Perhaps besides picking a default you maybe need to do some missing datalayout init?
1 parent c38e637 commit 79faa08

37 files changed

+48
-37
lines changed

clang/test/CIR/Lowering/OpenMP/barrier.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s
33

44

55
module {

clang/test/CIR/Lowering/OpenMP/parallel.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s
22

33
!s32i = !cir.int<s, 32>
44
module {

clang/test/CIR/Lowering/OpenMP/taskwait.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s
22

33

44
module {

clang/test/CIR/Lowering/OpenMP/taskyield.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s
22

33

44
module {

clang/test/CIR/Lowering/array.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>
55
!ty_S = !cir.struct<struct "S" {!s32i} #cir.record.decl.ast>

clang/test/CIR/Lowering/attribute-lowering.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
22

33
!s32i = !cir.int<s, 32>
44
!s8i = !cir.int<u, 8>

clang/test/CIR/Lowering/binop-fp.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/binop-overflow.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
33

44
!u32i = !cir.int<u, 32>
55
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/binop-unsigned-int.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33
!u32i = !cir.int<u, 32>
44

55
module {

clang/test/CIR/Lowering/bitint.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>
55

clang/test/CIR/Lowering/bool-to-int.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s
22

33
!s32i = !cir.int<s, 32>
44
#false = #cir.bool<false> : !cir.bool

clang/test/CIR/Lowering/bool.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
#false = #cir.bool<false> : !cir.bool
55
#true = #cir.bool<true> : !cir.bool

clang/test/CIR/Lowering/branch.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>
55
cir.func @foo(%arg0: !cir.bool) -> !s32i {

clang/test/CIR/Lowering/brcond.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>
55
#fn_attr = #cir<extra({inline = #cir.inline<no>, nothrow = #cir.nothrow, optnone = #cir.optnone})>

clang/test/CIR/Lowering/bswap.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!u32i = !cir.int<u, 32>
55

clang/test/CIR/Lowering/call-op-call-conv.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering %s -o %t.ll
1+
// RUN: cir-translate -cir-to-llvmir --disable-cc-lowering %s -o %t.ll
22
// RUN: FileCheck --input-file=%t.ll %s --check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/call.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33
// XFAIL: *
44

55
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/cmp3way.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!s8i = !cir.int<s, 8>
55
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/complex.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o %t.ll %s
1+
// RUN: cir-translate -cir-to-llvmir --disable-cc-lowering -o %t.ll %s
22
// RUN: FileCheck --input-file %t.ll -check-prefix=LLVM %s
33

44
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/const-array.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
22

33
!u8i = !cir.int<u, 8>
44
#false = #cir.bool<false> : !cir.bool

clang/test/CIR/Lowering/expect.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!s64i = !cir.int<s, 64>
55
module {

clang/test/CIR/Lowering/func-call-conv.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o %t.ll
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o %t.ll
22
// RUN: FileCheck %s --input-file=%t.ll --check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/globals.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: cir-opt %s -cir-to-llvm -o %t.mlir
22
// RUN: FileCheck --input-file=%t.mlir %s -check-prefix=MLIR
3-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o %t.ll
3+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o %t.ll
44
// RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM
55

66
!void = !cir.void

clang/test/CIR/Lowering/if.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33
!s32i = !cir.int<s, 32>
44

55
module {

clang/test/CIR/Lowering/int-wrap.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!s32i = !cir.int<s, 32>
55
module {

clang/test/CIR/Lowering/intrinsics.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
module {
55
cir.func @test_unreachable() {

clang/test/CIR/Lowering/ptrdiff.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s
22

33
!s32i = !cir.int<s, 32>
44
!u64i = !cir.int<u, 64>

clang/test/CIR/Lowering/region-simplify.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -canonicalize -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-opt %s -canonicalize -o - | cir-translate -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-opt %s -canonicalize -o - | cir-translate -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33

44
!u32i = !cir.int<u, 32>
55

clang/test/CIR/Lowering/scope.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: cir-opt %s -cir-to-llvm -o %t.cir
22
// RUN: FileCheck %s --input-file=%t.cir -check-prefix=MLIR
3-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
3+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
44
!u32i = !cir.int<u, 32>
55

66
module {

clang/test/CIR/Lowering/select.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o %t.ll %s
1+
// RUN: cir-translate -cir-to-llvmir --disable-cc-lowering -o %t.ll %s
22
// RUN: FileCheck --input-file=%t.ll -check-prefix=LLVM %s
33

44
!s32i = !cir.int<s, 32>

clang/test/CIR/Lowering/syncscope.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
1+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering -o - | FileCheck %s -check-prefix=LLVM
22

33
!s32i = !cir.int<s, 32>
44
#fn_attr = #cir<extra({inline = #cir.inline<no>, nothrow = #cir.nothrow, optnone = #cir.optnone})>

clang/test/CIR/Lowering/unary-inc-dec.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33
!s32i = !cir.int<s, 32>
44
module {
55
cir.func @foo() {

clang/test/CIR/Lowering/unary-not.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
2-
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
2+
// RUN: cir-translate %s -cir-to-llvmir --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
33
!s32i = !cir.int<s, 32>
44
module {
55
cir.func @foo() -> !s32i {

clang/test/CIR/Tools/cir-translate/no-triple-has-data-layout.cir

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// RUN: FileCheck %s -input-file %t.x86.ll -check-prefix=X86
33
// RUN: cir-translate --cir-to-llvmir --target spirv64-unknown-unknown --disable-cc-lowering %s -o %t.spirv64.ll
44
// RUN: FileCheck %s -input-file %t.spirv64.ll -check-prefix=SPIRV64
5+
// RUN: cir-translate --cir-to-llvmir --disable-cc-lowering %s -o %t.default.ll
6+
// RUN: FileCheck %s -input-file %t.default.ll -check-prefix=DEFAULT
57

68
module attributes {
79
dlti.dl_spec = #dlti.dl_spec<"dlti.global_memory_space" = 7 : ui64>
@@ -16,3 +18,6 @@ module attributes {
1618

1719
// SPIRV64-NOT: target datalayout = "G7"
1820
// SPIRV64-DAG: target triple = "spirv64-unknown-unknown"
21+
22+
// DEFAULT-NOT: target datalayout = "G7"
23+
// DEFAULT-DAG: target triple = "x86_64-unknown-linux-gnu"

clang/test/CIR/Tools/cir-translate/no-triple-no-data-layout.cir

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// RUN: FileCheck %s -input-file %t.x86.ll -check-prefix=X86
33
// RUN: cir-translate --cir-to-llvmir --target spirv64-unknown-unknown --disable-cc-lowering %s -o %t.spirv64.ll
44
// RUN: FileCheck %s -input-file %t.spirv64.ll -check-prefix=SPIRV64
5+
// RUN: cir-translate --cir-to-llvmir --disable-cc-lowering %s -o %t.default.ll
6+
// RUN: FileCheck %s -input-file %t.default.ll -check-prefix=DEFAULT
57

68
module {
79
cir.func @foo() {
@@ -14,3 +16,6 @@ module {
1416

1517
// SPIRV64-DAG: target triple = "spirv64-unknown-unknown"
1618
// SPIRV64-DAG: target datalayout = "{{.*}}"
19+
20+
// DEFAULT-DAG: target triple = "x86_64-unknown-linux-gnu"
21+
// DEFAULT-DAG: target datalayout = "{{.*}}"

clang/test/CIR/Tools/cir-translate/warn-default-triple.cir

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// XFAIL: target={{.*windows.*}}
2-
// RUN: cir-translate -verify-diagnostics --cir-to-llvmir --disable-cc-lowering %s 2>&1
1+
// RUN: cir-translate -verify-diagnostics --cir-to-llvmir --disable-cc-lowering %s
32

4-
// expected-warning@below {{no target triple provided, assuming}}
3+
// expected-warning@below {{no target triple provided, assuming x86_64-unknown-linux-gnu}}
54
module {
65
cir.func @foo() {
76
cir.return

clang/tools/cir-translate/cir-translate.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ std::string prepareCIRModuleTriple(mlir::ModuleOp mod) {
6969

7070
// Treat "" as the default target machine.
7171
if (triple.empty()) {
72-
triple = llvm::sys::getDefaultTargetTriple();
72+
// Currently ClangIR only supports a couple of targets. Not specifying a
73+
// target triple will default to x86_64-unknown-linux-gnu.
74+
triple = "x86_64-unknown-linux-gnu";
7375

7476
mod.emitWarning() << "no target triple provided, assuming " << triple;
7577
}

0 commit comments

Comments
 (0)