| 1 |
; REQUIRES: amdgpu-registered-target |
| 2 |
; RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -S -o - %s 2>&1 | FileCheck %s |
| 3 |
|
| 4 |
; Check that a DiagnosticUnsupported reported as a warning works |
| 5 |
; correctly, and is not emitted as an error. |
| 6 |
|
| 7 |
; CHECK: warning: test.c:2:20: in function use_lds_global_in_func i32 (): local memory global used by non-kernel function |
| 8 |
|
| 9 |
target triple = "amdgcn-amd-amdhsa" |
| 10 |
|
| 11 |
@lds = external addrspace(3) global i32, align 4 |
| 12 |
|
| 13 |
define i32 @use_lds_global_in_func() !dbg !5 { |
| 14 |
%load = load i32, ptr addrspace(3) @lds, !dbg !9 |
| 15 |
ret i32 %load, !dbg !10 |
| 16 |
} |
| 17 |
|
| 18 |
!llvm.dbg.cu = !{!0} |
| 19 |
!llvm.module.flags = !{!3, !4} |
| 20 |
|
| 21 |
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 22 |
!1 = !DIFile(filename: "test.c", directory: "") |
| 23 |
!2 = !{} |
| 24 |
!3 = !{i32 2, !"Dwarf Version", i32 4} |
| 25 |
!4 = !{i32 2, !"Debug Info Version", i32 3} |
| 26 |
!5 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !6, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) |
| 27 |
!6 = !DISubroutineType(types: !7) |
| 28 |
!7 = !{!8} |
| 29 |
!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 30 |
!9 = !DILocation(line: 2, column: 20, scope: !5) |
| 31 |
!10 = !DILocation(line: 2, column: 13, scope: !5) |