blob: 3f1caf927dc810e731adadc59ca60c117ccc4c7c [file] [log] [blame]
Jonas Hahnfeld5db24d72017-12-04 14:19:33 +00001; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
Eli Benderskyd47a5c22014-03-10 20:36:04 +00003
Eli Bendersky264cd462014-03-31 15:56:26 +00004; Verify that the NVPTX target removes invalid symbol names prior to emitting
5; PTX.
Eli Benderskyd47a5c22014-03-10 20:36:04 +00006
Jonas Hahnfeld5db24d72017-12-04 14:19:33 +00007; CHECK-NOT: .str
8; CHECK-NOT: .function.
Eli Bendersky264cd462014-03-31 15:56:26 +00009
Jonas Hahnfeld5db24d72017-12-04 14:19:33 +000010; CHECK-DAG: _$_str
11; CHECK-DAG: _$_str1
Eli Bendersky264cd462014-03-31 15:56:26 +000012
Jonas Hahnfeld5db24d72017-12-04 14:19:33 +000013; CHECK-DAG: _$_function_$_
14; CHECK-DAG: _$_function_$_2
Eli Bendersky264cd462014-03-31 15:56:26 +000015
16target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
17target triple = "nvptx64-unknown-unknown"
18
19
20@.str = private unnamed_addr constant [13 x i8] c"%d %f %c %d\0A\00", align 1
21@_$_str = private unnamed_addr constant [13 x i8] c"%d %f %c %d\0A\00", align 1
22
23
24; Function Attrs: nounwind
Jonas Hahnfeld5db24d72017-12-04 14:19:33 +000025define internal void @.function.() {
Eli Bendersky264cd462014-03-31 15:56:26 +000026entry:
David Blaikie23af6482015-04-16 23:24:18 +000027 %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0))
Eli Bendersky264cd462014-03-31 15:56:26 +000028 ret void
29}
30
Jonas Hahnfeld5db24d72017-12-04 14:19:33 +000031; Function Attrs: nounwind
32define internal void @_$_function_$_() {
33entry:
34 %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @_$_str, i32 0, i32 0))
35 ret void
36}
37
38; Function Attrs: nounwind
39define void @global_function() {
40entry:
41 call void @.function.()
42 call void @_$_function_$_()
43 ret void
44}
45
Eli Bendersky264cd462014-03-31 15:56:26 +000046declare i32 @printf(i8*, ...)